#include <wio.h>
#include "defs.h"
#include "transmission.h"
Go to the source code of this file.
|
wtp_status_t | wtp_init (wtp_t *self, uint8_t *epc_mem, uint16_t epc_buf_size, uint8_t *read_mem, uint8_t *write_mem, uint16_t window_size, uint16_t timeout, uint16_t tx_buf_size, uint16_t rx_buf_size, uint8_t n_send, uint8_t n_recv) |
| Initialize WTP endpoint. More...
|
|
wtp_status_t | wtp_fini (wtp_t *self) |
| Finalize WTP endpoint. More...
|
|
wtp_status_t | wtp_connect (wtp_t *self) |
| Connect to WTP server. More...
|
|
wtp_status_t | wtp_close (wtp_t *self) |
| Disconnect from WTP server. More...
|
|
wtp_status_t | wtp_send (wtp_t *self, uint8_t *data, uint16_t size, void *cb_data, wio_callback_t cb) |
| Send message to WTP server. More...
|
|
wtp_status_t | wtp_recv (wtp_t *self, void *cb_data, wio_callback_t cb) |
| Receive message from WTP server. More...
|
|
wtp_status_t | wtp_on_event (wtp_t *self, wtp_event_t event, void *cb_data, wio_callback_t cb) |
| Set WTP event handler. More...
|
|
wtp_status_t | wtp_trigger_event (wtp_t *self, wtp_event_t event, wtp_status_t status, void *result) |
| Trigger WTP event. More...
|
|
wtp_status_t | wtp_load_read_mem (wtp_t *self) |
| Load RFID READ memory for WTP communication. More...
|
|
wtp_status_t | wtp_handle_blockwrite (wtp_t *self) |
| Handle RFID BLOCKWRITE operation. More...
|
|
wtp_status_t | wtp_verify_checksum (wtp_t *self, wio_buf_t *write_buf) |
| Verify the checksum of received WTP packet. More...
|
|
uint8_t | wtp_xor_checksum (uint8_t *mem, uint16_t begin, uint16_t end) |
| WTP Xor checksum function. More...
|
|
◆ wtp_close()
Disconnect from WTP server.
- Parameters
-
self | WTP endpoint instance. |
- Returns
- Error code if failed, otherwise WIO_OK.
◆ wtp_connect()
Connect to WTP server.
- Parameters
-
self | WTP endpoint instance. |
- Returns
- Error code if failed, otherwise WIO_OK.
◆ wtp_fini()
Finalize WTP endpoint.
- Parameters
-
self | WTP endpoint instance. |
- Returns
- WIO_OK.
◆ wtp_handle_blockwrite()
Handle RFID BLOCKWRITE operation.
- Parameters
-
self | WTP endpoint instance. |
- Returns
- Error code if failed, otherwise WIO_OK.
◆ wtp_init()
wtp_status_t wtp_init |
( |
wtp_t * |
self, |
|
|
uint8_t * |
epc_mem, |
|
|
uint16_t |
epc_buf_size, |
|
|
uint8_t * |
read_mem, |
|
|
uint8_t * |
write_mem, |
|
|
uint16_t |
window_size, |
|
|
uint16_t |
timeout, |
|
|
uint16_t |
tx_buf_size, |
|
|
uint16_t |
rx_buf_size, |
|
|
uint8_t |
n_send, |
|
|
uint8_t |
n_recv |
|
) |
| |
Initialize WTP endpoint.
- Parameters
-
self | WTP endpoint instance. |
epc_mem | EPC-96 data section memory. |
epc_buf_size | Size of the EPC-96 data section. |
read_mem | Read memory. |
write_mem | BlockWrite memory. |
window_size | WTP sliding window size. |
timeout | WTP packet retransmission timeout. |
tx_buf_size | Transmit control buffer size. |
rx_buf_size | Receive control buffer size. |
n_send | Capacity of send callbacks. |
n_recv | Capacity of receive callbacks. |
- Returns
- WIO_ERR_NO_MEMORY if memory allocation failed, otherwise WIO_OK.
◆ wtp_load_read_mem()
Load RFID READ memory for WTP communication.
- Parameters
-
self | WTP endpoint instance. |
- Returns
- Error code if failed, otherwise WIO_OK.
◆ wtp_on_event()
Set WTP event handler.
- Parameters
-
self | WTP endpoint instance. |
event | WTP event. |
cb_data | Callback closure data. |
cb | Callback function. |
- Returns
- WIO_ERR_INVALID for invalid event, otherwise WIO_OK.
◆ wtp_recv()
Receive message from WTP server.
- Parameters
-
self | WTP endpoint instance. |
cb_data | Callback closure data. |
cb | Callback function. |
- Returns
- WIO_ERR_NO_MEMORY if no memory available for storing callback, otherwise WIO_OK.
◆ wtp_send()
Send message to WTP server.
- Parameters
-
self | WTP endpoint instance. |
data | Data to send. |
size | Size of data. |
cb_data | Callback closure data. |
cb | Callback function. |
- Returns
- Error code if failed, otherwise WIO_OK.
◆ wtp_trigger_event()
Trigger WTP event.
- Parameters
-
self | WTP endpoint instance. |
event | WTP event. |
status | Event status. |
result | Event result. |
- Returns
- Status code returned by repsective callback function.
◆ wtp_verify_checksum()
Verify the checksum of received WTP packet.
- Parameters
-
self | WTP endpoint instance. |
write_buf | Received WTP packets buffer. |
- Returns
- Error code if checksum validation failed, otherwise WIO_OK.
◆ wtp_xor_checksum()
uint8_t wtp_xor_checksum |
( |
uint8_t * |
mem, |
|
|
uint16_t |
begin, |
|
|
uint16_t |
end |
|
) |
| |
WTP Xor checksum function.
- Parameters
-
mem | Memory to calculate checksum. |
begin | Begin index for checksum calculation. |
end | End index for checksum calculation. |
- Returns
- Xor checksum for given range of memory.