API Reference
This page describes the concepts and operations needed to implement a client application for the Anova Precision Cooker Nano, independent of any specific programming language.
Core Constants
Constants that should be defined in any implementation:
// Service UUID
SERVICE_UUID = "0e140000-0af1-4582-a242-773e63054c68"
// Characteristic UUIDs
TX_CHAR_UUID = "0e140001-0af1-4582-a242-773e63054c68"
RX_CHAR_UUID = "0e140002-0af1-4582-a242-773e63054c68"
ASYNC_CHAR_UUID = "0e140003-0af1-4582-a242-773e63054c68"
// Scale factors
TEMP_SCALE = 10.0
SCAN_TIMEOUT = 5.0
// Domains
DOMAIN_CONFIG = 0x01
// Message types (for CONFIG domain)
GET_TEMP_UNITS = 0x04
SET_TEMP_UNITS = 0x03
GET_TEMP_SETPOINT = 0x02
SET_TEMP_SETPOINT = 0x01
GET_COOKING_TIMER = 0x06
SET_COOKING_TIMER = 0x05
GET_FIRMWARE_INFO = 0x01
GET_SENSORS = 0x01
START_COOKING = 0x01
STOP_COOKING = 0x02
Core Components
Any implementation should include these key components:
Device Scanner
Functionality for discovering compatible devices:
Operation | Description |
---|---|
Scan for devices | Look for devices advertising the Nano service UUID |
Select device | Choose appropriate device from scan results |
Device Client
Core functionality for device communication:
Operation | Description |
---|---|
Connect | Establish connection and set up notifications |
Disconnect | Safely disconnect from device |
Send command | Format, encode and send a command, then receive the response |
Handle notifications | Process notifications from RX and Async characteristics |
COBS Encoding/Decoding
Functions for message encoding and decoding:
Operation | Description |
---|---|
COBS encode | Encode data using Consistent Overhead Byte Stuffing |
COBS decode | Decode COBS-encoded data |
Frame message | Append terminator byte to COBS-encoded data |
Parse response | Extract domain, message type, and payload from decoded response |
Command Handlers
Higher-level operations for device control:
Operation | Description |
---|---|
Get temperature unit | Read current temperature unit setting |
Set temperature unit | Change temperature unit (C/F) |
Get target temperature | Read current target temperature |
Set target temperature | Set new target temperature |
Get timer | Read current timer value |
Set timer | Set new timer duration |
Get firmware info | Read firmware version information |
Get sensor readings | Read current sensor values |
Start cooking | Begin cooking process |
Stop cooking | End cooking process |
Device Operations
Device Discovery
1. Create BLE scanner
2. Filter for service UUID "0e140000-0af1-4582-a242-773e63054c68"
3. Return list of matching devices
Connection Setup
1. Select device from discovery results
2. Establish connection
3. Set up notifications on RX and Async characteristics
4. Initialize by reading temperature unit and firmware info
Command Execution Flow
1. Create header bytes [domain, message_type]
2. Add serialized payload if required
3. COBS encode the entire message
4. Append 0x00 terminator
5. Split into chunks (≤ 20 bytes)
6. Send chunks to TX characteristic
7. Collect response chunks from RX
8. Decode complete response
9. Parse using appropriate protocol buffer type
COBS Algorithm
Encoding
function cobs_encode(data):
result = new byte array
code_pointer = 0
code = 1
for each byte in data:
if byte == 0:
result[code_pointer] = code
code_pointer = result.length
result.append(0)
code = 1
else:
result.append(byte)
code += 1
if code == 0xFF:
result[code_pointer] = code
code_pointer = result.length
result.append(0)
code = 1
result[code_pointer] = code
return result
Decoding
function cobs_decode(data):
result = new byte array
code = 0
block_length = 0
i = 0
while i < data.length:
code = data[i]
i += 1
block_length = code - 1
// Copy block_length bytes to result
copy data[i] through data[i+block_length-1] to result
i += block_length
if i < data.length and code != 0xFF:
result.append(0)
return result
Example Command Implementations
Read Temperature Unit
1. Create command bytes: [DOMAIN_CONFIG, GET_TEMP_UNITS]
2. COBS encode
3. Append 0x00
4. Send to TX characteristic
5. Receive and decode response as IntegerValue
6. Convert value to unit string ("C" or "F")
Set Target Temperature
1. Create IntegerValue with scaled temperature (temp * 10)
2. Serialize to binary
3. Create command: [DOMAIN_CONFIG, SET_TEMP_SETPOINT] + serialized payload
4. COBS encode
5. Append 0x00
6. Send to TX characteristic
Start Cooking
1. Create command bytes: [DOMAIN_CONFIG, START_COOKING]
2. COBS encode
3. Append 0x00
4. Send to TX characteristic
Error Handling
Implement appropriate error handling for:
- Connection failures
- COBS encoding/decoding errors
- Missing or invalid responses
- BLE disconnections
- Protocol buffer parsing errors
Remember that the Nano device uses a temperature scale factor of 10, not 100 as with other Anova devices.
Most programming languages have libraries for COBS encoding/decoding. If not, implement the algorithms shown above.
The BLE MTU is typically 20 bytes. Commands and responses exceeding this size must be properly chunked and reassembled.