43 #ifndef CA821X_POSIX_H
44 #define CA821X_POSIX_H 1
Various types used by the cascoda posix api.
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
ca821x_exchange_type
Enumeration for identifying the underlying exchange interface type.
Definition: ca821x-types.h:166
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
ca_error(* ca821x_errorhandler)(ca_error error, struct ca821x_dev *pDeviceRef)
Error callback.
Definition: ca821x-types.h:61
The main ca821x-api include file.
ca_error
Cascoda error type.
Definition: ca821x_error.h:51
ca_error exchange_user_command(uint8_t cmdid, uint8_t cmdlen, uint8_t *payload, struct ca821x_dev *pDeviceRef)
Sends a user-defined command over the connected interface.
Definition: ca821x-generic-exchange.c:293
void ca821x_util_deinit(struct ca821x_dev *pDeviceRef)
Generic function to deinitialise an initialised ca821x device.
Definition: ca821x-posix-util.c:148
ca_error ca821x_util_init(struct ca821x_dev *pDeviceRef, ca821x_errorhandler errorHandler, union ca821x_util_init_extra_arg arg)
Generic function to initialise an available ca821x device.
Definition: ca821x-posix-util.c:72
ca_error ca821x_util_reset(struct ca821x_dev *pDeviceRef)
Generic function to attempt a hard reset of the ca821x chip.
Definition: ca821x-posix-util.c:286
ca_error exchange_register_user_callback(exchange_user_callback callback, struct ca821x_dev *pDeviceRef)
Registers the callback to call for any non-ca821x commands that are sent over the interface.
Definition: ca821x-generic-exchange.c:261
ca_error ca821x_util_start_upstream_dispatch_worker()
Start the upstream_dispatch worker, which asynchronously calls the message callbacks (such as MCPS_DA...
Definition: ca821x-generic-exchange.c:136
ca_error ca821x_util_enumerate(util_device_found aCallback, bool enumerate_uart, void *aContext)
Function to enumerate all of the connected devices, calling aCallback with a struct describing each o...
Definition: ca821x-posix-util.c:274
ca_error ca821x_util_dispatch_poll()
Generic function to poll the receive queue and call callbacks for received commands.
Definition: ca821x-generic-exchange.c:99
ca_error exchange_wait_send_complete(time_t timeout_s, struct ca821x_dev *pDeviceRef)
Query whether the given exchange has any messages pending being sent in its send queue.
Definition: ca821x-generic-exchange.c:273
ca_error ca821x_util_init_path(struct ca821x_dev *pDeviceRef, ca821x_errorhandler errorHandler, enum ca821x_exchange_type exchangeType, const char *path)
Generic function to initialise a specific device as found via ca821x_util_enumerate or other mechanis...
Definition: ca821x-posix-util.c:105
ca_error ca821x_util_stop_upstream_dispatch_worker()
Stop the upstream_dispatch worker, so callbacks will no longer be triggered from a separate thread.
Definition: ca821x-generic-exchange.c:157
CA-821x Device reference struct.
Definition: ca821x_api.h:123