1 Introduction 1 Introduction In general, BLE integration into the TWN4 BLE reader family is performed via the API interface. The individual API functions control the BLE controller. The following graphic shows the TWN4 BLE Open System Interconnection model as an overview.
"Mobile Badge 2.0" is a virtually programmed card which runs as an application on a phone. The app connects to the TWN4 reader and presents the reader with a GATT server for reading and writing. The authentication process is an AES128 process with two ways to securely authenticate the device.
"Mobile Badge 2.0" (e.g. the phone app on Android or iPhone). 2.1.2 Reader with Simple Protocol The TWN4 Reader’s Simple Protocol is a very flexible way to control the TWN4 Reader over a serial connection. Setup your reader with Simple Protocol for reading cards: Flash the simple protocol firmware "TWN4_NCx321_PRS104_Nano_CDC_Simple_Protocol.bix"...
Page 6
2 Mobile Badge 2.0 Note: The ID of Tag Type BLE is 128 bits (= 16 bytes). The length of the data sent by the app depends on the application. The minimum data length is 8 bytes. Page 6 of 18...
2 Mobile Badge 2.0 2.1.3 Third Party Reader App The reading of cards is done with the Standard app. To read "Mobile Badge 2.0" cards, the app must be extended with the following source code: main(void) OnStartup(); SetTagTypes(LFTAGTYPES,HFTAGTYPES & ~BLE_MASK); if(BLEInit(BLE_MODE_MOBILE_BADGE_2_0)) OnBLEStarted();...
2.2.3.1 Advertise-String The TWN4 reader in the initialized mode "Mobile Badge 2.0" advertises with a preset reader string, which you can change with your own information. The default advertiser string sent by the reader has the following properties: "Bluetooth Low Energy"...
Start the function BLEInit(BLE_MODE_MOBILE_BADGE_2_0) and the fetch/read routine with Search- Tag(). Use the application to connect to the TWN4 reader (the default requirement is "Bluetooth Low Energy" Type, Reader Name "ELATEC", Manufacturer ID "ELATEC", and RSSI in the desired range).
The streaming mode is an operating mode for transferring individual bytes or blocks (up to 200 bytes at once) from one device to another and vice versa. One device is a TWN4 BLE reader and the other a second TWN4 device, a phone, a PC or another device.
Page 11
// Length of the Manufacturer Data field 0xff, // Data type - manufacturer specific data - Manufacturer Data field 0x52,0x07, // Manufacturer data, Company ID field - 0x0752 = Elatec GmbH SIG // Application Code 1 (example from Elatec) 0x00,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00 const byte UUID_SPP[16] = {0x8e,0xdf,0xae,0x3d,0x9b,0xcd,0x0e,0x88,0x74,0x42,0x12,0x41,0x04, 0xc0,0x44,0x5a};...
3 Cable Replacement 3.1.2 Transparent Data Transfer with 2 Readers This chapter describes how to transmit data in a transparent mode between two TWN4 BLE readers. Both readers are connected with e.g. HTerm (terminal program) for individual data transmission. The sample code shows the configuration in block mode.
3.2 Datatransfer = BYTEWISE 3.2.1 Transparent Data Transfer with 2 Readers This chapter describes how to transmit data in a transparent mode between two TWN4 BLE readers. Both readers are connected with e.g. HTerm (terminal program) for individual data transmission. The sample code shows the configuration in byte mode.
3 Cable Replacement Once: BLEPresetConfig($881300000AA1A0000702020000D2040000) BLEInit(BLE_MODE_CUSTOM) BLESetStreamingUUID($8edfae3d9bcd0e887442124104c0445a,$52c79e169d4822aa434c0a2fdf9ec243) BLESetStreamingMode(BLE_STREAM_CONN_ADVERTISE,BLE_STREAM_GATT_SERVER, BLE_STREAM_TRANSFER_BYTEWISE) Cycle: TestEmpty(CHANNEL_BLE, DIR_IN) ReadByte(CHANNEL_BLE); WriteByte(CHANNEL_BLE, ch); Note that function ReadByte(..) is a blocking function! 3.2.2.2 Reader B as Scanner, GATT Client The Reader B is a BLE scanner and a GATT client for data transfer. Testing the configuration with Direc- tor.exe is possible.
4 Disclaimer 4 Disclaimer Elatec reserves the right to change any information or data in this document without prior notice. The distribution and the update of this document is not controlled. Elatec declines all responsibility for the use of product with any other specifications but the ones mentioned above. Any additional requirement for a specific custom application has to be validated by the customer himself at his own responsibility.
Need help?
Do you have a question about the TWN4 and is the answer not in the manual?
Questions and answers