Data Sheet

void dexcom_src_to_ascii(uint32 src, char addr[6])
{
//each src value is 5 bits long, and is converted in this way.
addr[0] = SrcNameTable[(src >> 20) & 0x1F]; //the last
character is the src, shifted right 20 places, ANDED with 0x1F
addr[1] = SrcNameTable[(src >> 15) & 0x1F]; //etc
addr[2] = SrcNameTable[(src >> 10) & 0x1F]; //etc
addr[3] = SrcNameTable[(src >> 5) & 0x1F]; //etc
addr[4] = SrcNameTable[(src >> 0) & 0x1F]; //etc
addr[5] = 0; //end the string with a null character.
}
Note on Promiscuous mode
In this code, if the wixel is NOT sent a TXID packet, it will NOT collect packets from any
Dexcom Transmitter and pass them to the smartphone app. This is a safety feature and is
by design. You do not want an app displaying or storing data from anyone else’s transmitter.
However, in the part of the code that collects packets, promiscuous mode is allowed.
If you really wish to use promiscuous mode, comment out the section in main() that is clearly
commented as the section that sends beacons until a TXID packet sets the transmitter ID.
Then simply never send a TXID packet.
Basic code operations
The Wixel code uses the following steps when it wakes up or is powered on.
Initialises all the base IO and Wixel systems.
Waits for 30 seconds, processing IO. This allows you to connect a serial terminal to
it via USB, so you can see what is going on.
Loads the internal Flash stored flags register to determine if it has set up the HM-1x
module. It only does this the first time it is run after the XBridge code is loaded. No
point doing it too often.
If the flag shows that the HM-1x is NOT configured, it will configure it.
Loads the Battery Capacity limits from Flash. If these are not set up, it sets them to
default values.
Loads the TXID value from Flash.
Powers up the HM-1x module.
If the TXID value is NOT set, it goes into a loop, waiting for a BLE connection, and
then sends Beacon packets until it gets a TXID packet. It then stores all the settings
to flash, and moves on.
Goes into a loop where it listens for Dexcom Transmitter packet.
If a Dexcom Transmitter packet is not received in 320 seconds (5 minutes 20
seconds), it sends another beacon packet and tries again. The Wixel will NOT sleep
until it has captured a packet.
Once it has captured a packet, it waits for a BLE connection to be established
between the HM-1x and the phone. It then sends the Data packet.