Generic device commands

Generic device commands — Methods to run generic commands on the device state.

Functions

Description

This section defines methods to query the current device state.

Functions

mccr_device_run_generic ()

mccr_status_t
mccr_device_run_generic (mccr_device_t *device,
                         uint8_t command_id,
                         const uint8_t *blob,
                         size_t blob_size,
                         uint8_t **out_blob,
                         size_t *out_blob_size);

Run a generic command in the device.

If the command is privileged, blob and blob_size should include the trailing MAC.

E.g. if the command to run is '01:06:10:00:B7:6E:44:1F', command_id would be 0x01, blob_size would be 6, and blob would be '10:00:B7:6E:44:1F' (of which the first two bytes (10:00) is the real command data and the last 4 bytes (B7:6E:44:1F) is the MAC for the privileged command).

Parameters

device

an open mccr_device_t.

 

command_id

the command id.

 

blob

binary blob with the command data, or NULL if blob_size is 0.

 

blob_size

size of blob .

 

out_blob

output location for the response blob, or NULL if none expected.

 

out_blob_size

output location for the size_t with the size of out_blob , or NULL if none expected.

 

Returns

a mccr_status_t.

Types and Values