36 #ifndef CA821X_TYPES_H_
37 #define CA821X_TYPES_H_
43 #include "ca821x-posix/ca821x-posix-config.h"
186 pthread_cond_t q_cond;
207 pthread_mutex_t sync_mutex;
void(* util_device_found)(struct ca_device_info *aDeviceInfo, void *aContext)
Function type for handling enumerated devices when finding them.
Definition: ca821x-types.h:241
void(* exchange_flush_unread)(struct ca821x_dev *pDeviceRef)
Exchange signalling function to flush external buffers.
Definition: ca821x-types.h:147
void(* exchange_signal_read)(struct ca821x_dev *pDeviceRef)
Exchange signalling function to trigger read return.
Definition: ca821x-types.h:133
ca_error(* exchange_write_isready)(struct ca821x_dev *pDeviceRef)
Exchange write isready function.
Definition: ca821x-types.h:103
ca_error(* exchange_write)(const uint8_t *buf, size_t len, struct ca821x_dev *pDeviceRef)
Exchange write function.
Definition: ca821x-types.h:89
ca821x_exchange_type
Enumeration for identifying the underlying exchange interface type.
Definition: ca821x-types.h:166
@ ca821x_exchange_usb
USB HID device.
Definition: ca821x-types.h:168
@ ca821x_exchange_uart
UART device.
Definition: ca821x-types.h:169
@ ca821x_exchange_kernel
kernel driver's debugfs node
Definition: ca821x-types.h:167
ca_error(* exchange_user_callback)(const uint8_t *buf, size_t len, struct ca821x_dev *pDeviceRef)
Optional Exchange User Callback.
Definition: ca821x-types.h:75
ssize_t(* exchange_read)(struct ca821x_dev *pDeviceRef, uint8_t *buf)
Exchange read function.
Definition: ca821x-types.h:121
ca_error(* ca821x_errorhandler)(ca_error error, struct ca821x_dev *pDeviceRef)
Error callback.
Definition: ca821x-types.h:61
The main ca821x-api include file.
Global error declarations for use across the Cascoda SDK.
ca_error
Cascoda error type.
Definition: ca821x_error.h:51
Definition: ca821x-posix-evbme.h:57
Single item in a singly-linked list of data buffers.
Definition: ca821x-types.h:174
uint8_t * buf
Buffer pointer.
Definition: ca821x-types.h:176
size_t len
Length of buffer.
Definition: ca821x-types.h:175
struct ca821x_dev * pDeviceRef
Data's target/originating device.
Definition: ca821x-types.h:177
struct buffer_queue_item * next
Next queue item.
Definition: ca821x-types.h:178
Queue struct for singly-linked list of buffer_queue_items.
Definition: ca821x-types.h:183
pthread_mutex_t q_mutex
Definition: ca821x-types.h:185
struct buffer_queue_item * head
Definition: ca821x-types.h:184
CA-821x Device reference struct.
Definition: ca821x_api.h:123
Base structure for exchange private data collections.
Definition: ca821x-types.h:191
exchange_write_isready write_isready_func
Exchange write isready callback.
Definition: ca821x-types.h:197
int flash_fd
File descriptor for persistent storage file.
Definition: ca821x-types.h:215
uint32_t base_address
Base address of persistent storage.
Definition: ca821x-types.h:216
exchange_user_callback user_callback
User unhandled command callback.
Definition: ca821x-types.h:195
exchange_write write_func
Exchange write callback.
Definition: ca821x-types.h:196
pthread_cond_t sync_cond
condition variable for synchronous exchanges
Definition: ca821x-types.h:206
exchange_read read_func
Exchange read callback.
Definition: ca821x-types.h:199
exchange_flush_unread flush_func
Exchange flush callback.
Definition: ca821x-types.h:200
pthread_t io_thread
Thread for io handling.
Definition: ca821x-types.h:203
exchange_signal_read signal_func
Exchange write signalling callback.
Definition: ca821x-types.h:198
pthread_mutex_t flag_mutex
mutex for generic flag handling
Definition: ca821x-types.h:205
int io_thread_runflag
flag to shutdown io thread
Definition: ca821x-types.h:204
ca821x_errorhandler error_callback
Exchange error callback.
Definition: ca821x-types.h:194
Struct for getting info of connected devices (primarily for enumerating them)
Definition: ca821x-types.h:224
bool available
Is the device available for use (or not, eg.
Definition: ca821x-types.h:233
const char * serialno
Serial number of the device.
Definition: ca821x-types.h:230
bool external_flash_available
Does the device have an external flash chip.
Definition: ca821x-types.h:232
const char * version
Version string of the device.
Definition: ca821x-types.h:229
const char * app_name
Name of the application running on the device, eg 'ot-cli'.
Definition: ca821x-types.h:228
const char * device_name
Name of the device, eg 'Chili2'.
Definition: ca821x-types.h:227
const char * path
Exchange & system specific 'path', unique to this device.
Definition: ca821x-types.h:226