Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
software:timingunits:tcpimporter [2024/08/09 11:41] henriksoftware:timingunits:tcpimporter [2024/08/29 08:15] (current) henrik
Line 1: Line 1:
-=== Generic TCP importer ===+{{indexmenu_n>100}} 
 + 
 +====== Generic TCP importer ======
  
 Using a very simple text-based TCP protocol, you can have your own devices or integration component connect into BBT, and import raw time records this way, just like any natively supported box. Using a very simple text-based TCP protocol, you can have your own devices or integration component connect into BBT, and import raw time records this way, just like any natively supported box.
Line 5: Line 7:
 You can connect as many devices as you like, with each connection representing a device with an identifier of your choice. You can connect as many devices as you like, with each connection representing a device with an identifier of your choice.
 The default port is 12368, but this can be changed via the advanced event setting //ext.generictcp.inbound.port//. The default port is 12368, but this can be changed via the advanced event setting //ext.generictcp.inbound.port//.
 +
 +{{:software:timingunits:tcpimporter.png|}}
  
 == Protocol format == == Protocol format ==
Line 17: Line 21:
 The first command sent must be "hello", and include the protocol version (current is 1), and the identifier of the device. The identifer can consist of letters, numbers, underscore and dash, and is something you decide upon to distinguish it from other TCP importers you might use (like MyDevice). The identifier will be used inside BBT to assign the device to an event. The first command sent must be "hello", and include the protocol version (current is 1), and the identifier of the device. The identifer can consist of letters, numbers, underscore and dash, and is something you decide upon to distinguish it from other TCP importers you might use (like MyDevice). The identifier will be used inside BBT to assign the device to an event.
  
-Example command:+Example command:\\
 hello;v=1;identifier=MyDevice hello;v=1;identifier=MyDevice
  
-Response:+Response:\\
 hello;ok;host= Black Box Timing hello;ok;host= Black Box Timing
  
 == Sending records == == Sending records ==
-A timing record can be sent to the software using the record.add command. +A timing record can be sent to the software using the record.add command.\\ 
-Arguments are //tag// (chip code, rfid tag id, race number or similar), //time// (timestamp of the record)//, id//, //antenna// and //signal//+Arguments are //tag// (chip code, rfid tag id, race number or similar), //time// (timestamp of the record)//, id//, //antenna// and //signal//.\\ 
-Only //tag//  and //time// are required, and the argument order is irrelevant. +Only //tag//  and //time// are required, and the argument order is irrelevant.\\ 
-//id// is a unique 64-bit integer for this record if you wish to update it later, and is optional.+//id// is a unique 64-bit integer for this record if you wish to update it later, and is optional.\\
 //time// should be in the format yyyy-mm-ddTHH:mm:ss.ffffff (24 hour time, in local time zone) //time// should be in the format yyyy-mm-ddTHH:mm:ss.ffffff (24 hour time, in local time zone)
  
-Example commands: +Example commands:\\ 
-record.add;tag=ABC12345;time=2024-08-15T23:11:12.123456+record.add;tag=ABC12345;time=2024-08-15T23:11:12.123456\\
 record.add;tag=ABC12345;time=2024-08-15T23:11:12.123456;id=42;signal=-4.22;antenna=3 record.add;tag=ABC12345;time=2024-08-15T23:11:12.123456;id=42;signal=-4.22;antenna=3
  
-Responses: +Responses:\\ 
-record.add;ok+record.add;ok\\
 record.add;ok;id=42 record.add;ok;id=42
  
-Records can be updated using the record.update command. The arguments are the exact same as for record.add, but id is optional.+Records can be updated using the record.update command. The arguments are the exact same as for record.add, but id is required.
 If a record with the provided id does not exist, it might be created. If a record with the provided id does not exist, it might be created.
 +
 +== Device status ==
 +It is possible to send periodic device status information, such as vendor, model, battery information, GPS position, firmware version, read rates and much more. Contact us for details on the supported values.
 +
 +Example command:\\
 +status;device.vendor=My company;device.model=Cool Device Pro;power.battery.available=1;power.battery.pct=53;gps.satellites=7;temp.cpu=42
 +
 +Responses:\\
 +record.status;ok
 +
  
 == Inactivity == == Inactivity ==
Line 45: Line 59:
 You can send the "ping" command (with no parameters) to keep the connection alive. You can send the "ping" command (with no parameters) to keep the connection alive.
  
-Example command:+Example command:\\
 ping ping
  
-Response:+Response:\\
 ping;ok ping;ok
 +