New-Tech Europe Magazine | Oct 2017 | Digital Edition

Peripheral Only: Bluetooth as a transparent cable replacement Operation of the Bluetooth module with command control serves functionality – for example configuration in ongoing operation – and is ideal in terms of safety considerations (checksum). But sometimes the requirements are different. Alongside operation of themodule using commands, there is the "Peripheral Only” mode in such cases. Upgrading of devices is possible thanks to the transparent UART interface, whereby modification of the serial interface is neither desired nor possible. These could be industrial machines with an existing RS232 interface for instance. The manufacturer Amber wireless intentionally introduced the option of operating the wireless module as ‘Peripheral’ in the sense of the Bluetooth protocol, as this is interesting for very many applications. Devices are equipped with this kind of wireless module so you can connect with them. This means that pairing is initiated by a mobile device. Even without command control that would be necessary to switch off the module that is not required, AMB2621 is particularly power-saving in the “Peripheral Only” operating mode, as the UART interface is only active on establishing a wireless connection. Uncomplicated static passkey pairing is used as a security feature, as in the hands-free car kit. AMB2621 with Peripheral mode is recommended whenever the module does not initiate any connections itself (i.e. it is only contacted from the outside) or no user interface can be implemented, as the rest of the product is already finished. Bluetooth is the “cable replacement” in this application and communication is correspondingly simple. In the above example, in the “Peripheral Only” mode the host would only receive “Hey AMB2621!” without header and checksum bytes and would only need to send “Hey App!” to the module such

The commands of the AMBER firmware stack follow a simple structure:

Payload data

Start signal Command

Length

Checksum

byte 1

byte 1 bytes, least sig� 2 nificant byte first

x bytes

byte 1

followed by a 2-byte length field, the command-specific payload data and the attached checksum, which guarantees correct transmission of the byte sequence. The following example shows how this syntax looks in practice. In the case in which a smartphone with MAC 0x825CA7E287D0 connects with AMB2621, the AMB2621 sends the following notification via UART (Universal Asynchronous Receiver Transmitter) to the host connected: 0x02 0x86 0x07 0x00 0x00 0x82 0x5C 0xA7 0xE2 0x87 0xD0 0x4F (connection to the device with MAC 0x825CA7E287D0 is opened) 0x02 0xC6 0x08 0x00 0x00 0x82 0x5C 0xA7 0xE2 0x87 0xD0 0x13 0x13 (connection to the device with MAC 0x825CA7E287D0 has been opened The commands of the AMBER firmware stack follow a simple structure: Command Description 0x04 Send data 0x84 Data have been received 0x86 Connection is established 0xC6 Connection is open, data transfer now possible

If the smartphone now sends a notification “Hey AMB2621!”, e.g. with the help of the AMB2621 toolbox app, the AMB2621 transmits the following data via UART to the host connected: 0x02 0x84 0x13 0x00 0x82 0x5C 0xA7 0xE2 0x87 0xD0 0xC8 Hey AMB2621! 0x89 (Data have been received from the device with MAC 0x825CA7E287D0. The data

46 l New-Tech Magazine Europe

Made with FlippingBook - Online catalogs