Hide thumbs Also See for TWN4:

Advertisement

TWN4
BLE User Guide
DocRev2, June 17, 2020
Elatec GmbH

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TWN4 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Elatec TWN4

  • Page 1 TWN4 BLE User Guide DocRev2, June 17, 2020 Elatec GmbH...
  • Page 2: Table Of Contents

    2.1 TWN4 Firmware ........
  • Page 3: Introduction

    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.
  • Page 4: Mobile Badge 2.0

    "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.
  • Page 5: Reader With Simple Protocol

    "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...
  • Page 7: Third Party Reader App

    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();...
  • Page 8: Phone Applications

    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"...
  • Page 9: The Authentication Process

    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).
  • Page 10: Cable Replacement

    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};...
  • Page 12: Reader B As Scanner, Gatt Client And Connected To Director.exe

    3 Cable Replacement HostChannel = CHANNEL_BLE; // Simple Protocol is running in ASCII mode W/O CRC. SimpleProtoInit(HostChannel,PRS_COMM_MODE_ASCII | PRS_COMM_CRC_OFF); // Main loop while (true) (SimpleProtoTestCommand()) // SimpleProtoMessage (MessageLength now contains command from host) SimpleProtoExecuteCommand(); // SimpleProtoMessage (MessageLength now contains response to host) SimpleProtoSendResponse();...
  • Page 13 = 128 - (RSSIRaw&0x7F); if(rssi_tmp<50) BLEDiscover(BLE_DISC_STOP_PHY_1M, 0, &BLEUUID); byte DeviceAddress[6], Address[6], AdressType; BLEGetAddress(DeviceAddress,Address,&AdressType); if(BLEConnectToDevice(Address, AdressType)) BeepHigh(); BLEStatus = 1; break; break; // TWN4 Connected :-) if(BLEStatus==1) while(true) while(!TestEmpty(CHANNEL_BLE, DIR_IN)) byte ch = ReadByte(CHANNEL_BLE); WriteByte(CHANNEL_USB, ch); while(!TestEmpty(CHANNEL_USB, DIR_IN)) byte ch = ReadByte(CHANNEL_USB); WriteByte(CHANNEL_BLE, ch);...
  • Page 14: Transparent Data Transfer With 2 Readers

    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.
  • Page 15: Datatransfer = Bytewise

    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.
  • Page 16: Reader B As Scanner, Gatt Client

    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.
  • Page 17 3 Cable Replacement Cycle scan Advertiser reader and connect: BLECheckEvent() BLEGetEnvironment() -> RSSI Once connection: BLEDiscover(BLE_DISC_STOP_PHY_1M, 0,$1000000000000000800000000000000000) BLEGetAddress() BLEConnectToDevice() BLESetStreamingMode(BLE_STREAM_CONN_DISCOVER,BLE_STREAM_GATT_CLIENT, BLE_STREAM_TRANSFER_BYTEWISE) Cycle: TestEmpty(CHANNEL_BLE, DIR_IN) ReadByte(CHANNEL_BLE); WriteByte(CHANNEL_BLE, ch); Page 17 of 18...
  • Page 18: Disclaimer

    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.

Table of Contents

Save PDF