Bluetooth®
The foc.us gamer is a licensed Bluetooth® Smart device.
In response to popular demand we are publishing our bluetooth API. If you want to write your own application to control your foc.us the information required to do so is on this page. If you have a question please post it on stackoverflow and then email the link to support@foc.us and we will respond there.
The information provided on this page is the property of foc.us. It may only be used to create client software for use with foc.us products. Usage of this information does not constitute or infer any rights to ownership or guaranteed access or continuation of usage.
UUID | Permissions | Size | Name | Value | Unit | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0xfff1 | Read | 1 byte | Battery level | 0…100 | 1% | Battery level | ||||||||||||||||||||||||||||||||||||||||
0xfff2 | Read | 1 byte | Actual current | 0…200 | 0.01mA | The current level on the electrodes in real time | ||||||||||||||||||||||||||||||||||||||||
0xfff3 | Read/Write | 1 byte | Mode | See description |
| |||||||||||||||||||||||||||||||||||||||||
0xfff4 | Read/Write | 1 byte | Electrodes mode | See description |
Least nibble – left electrode Most nibble – right electrode This value can only be written in “paired” mode Value of nibble:
| |||||||||||||||||||||||||||||||||||||||||
0xfff6 | Read/Write | 2 bytes | Time in active mode | 0…65535 | 1s | Duration of the active mode | ||||||||||||||||||||||||||||||||||||||||
0xfff7 | Read/Write | 2 bytes | FW version FW update control |
FW version can be read in FW_IDLE mode. Range 0…65535 FW update control:
| ||||||||||||||||||||||||||||||||||||||||||
0xfff8 | Write | Item 20 bytes | FW data buffer | Buffer for data during firmware update process | ||||||||||||||||||||||||||||||||||||||||||
0xfff9 | Read/Write | 4 bytes | Pin code | 0…999999 | Pin code for pairing |
Table 2
UUID | Perm. | Size | Continuous Mode | Pulse Mode | Sinus Mode | Noise Mode | Fake Mode |
---|---|---|---|---|---|---|---|
0xfff5 | R/W | 1 byte | Max current 20…200 * 0,01mA | Max current 20…200 * 0,01mA | Max current 20…200 * 0,01mA | Max current 20…200 * 0,01mA | Max current 20…200 * 0,01mA |
0xfffa | R/W | 1 byte | N/A | Current offset 0…200 * 0.01mA | Current offset 0…200 * 0.01mA | Current offset 0…200 * 0.01mA | N/A |
0xfffb | R/W | 1 byte | Current rise/fall time 1…255*1s | Current rise/fall time 1…255*1s | Current rise/fall time 1…255*1s | Current rise/fall time 1…255*1s | Current rise/fall time 1…255*1s |
0xfffc | R/W | 2 byte | N/A | Pulse width 10…65335 * 1ms | Sinus wave period 2…65535 * 50ms | Min timestep 10…65535 * 1ms | N/A |
0xfffd | R/W | 2 byte | N/A | Pulse period 10…65535 * 1ms | N/A | Max timestep 10…65535 * 1ms | N/A |
FW update process description
- 1. Write FW_START value.
- 2. Send firmware file. Sending is made in blocks of 20 bytes, where least 2 bytes : data block number, and most 18 bytes : firmware data. Note. The size of any firmware file is a multiple of 18 bytes.
- 3. Write FW_END_DATA value.
- 4. Wait, while check sum is calculated. When it complete, device will set FW_CRC_OK or FW_CRC_ERROR state.
- 5. If state is FW_CRC_OK, write FW_BURN value for firmware rewriting. If state is FW_CRC_ERROR (firmware file was corrupted during transmission) go to step 1.
The Bluetooth® word mark and logos are registered trademarks owned by Bluetooth SIG, Inc. and any use of such marks by foc.us is under license. Other trademarks and trade names are those of their respective owners.