Sample of IEE11073 Communication Model.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | IEEE11073_ASSOC_ABORT 0 |
#define | IEEE11073_ASSOC_RUNNING 1 |
#define | IEEE11073_ASSOC_VALIDED 2 |
#define | IEEE11073_LGT_METADATA_IN 80 |
#define | IEEE11073_LGT_METADATA_OUT 80 |
#define | IEEE11073_LGT_OPAQUEDATA_IN 10 |
#define | IEEE11073_LGT_OPAQUEDATA_OUT 10 |
Functions | |
static bool | ieee11073_decode_metadata (void) |
Start the data reception on communication line. More... | |
static bool | ieee11073_enable_reception (void) |
Start the reception of data on communication line. More... | |
void | ieee11073_received (bool status, uint16_t nb_received) |
Callback called when a data is received. More... | |
static bool | ieee11073_send_association (void) |
static bool | ieee11073_send_mesure (uint8_t qos) |
void | ieee11073_sent (uint16_t nb_send) |
Callback called when a data is sent. More... | |
void | ieee11073_skeleton_disable (void) |
Disable the communication model processing. More... | |
bool | ieee11073_skeleton_enable (void) |
Enable the communication model processing. More... | |
bool | ieee11073_skeleton_process (void) |
Function to process communication model Must be scheduled by other process. More... | |
void | ieee11073_skeleton_send_measure_1 (void) |
Send a measure on communication line. More... | |
void | ieee11073_skeleton_send_measure_2 (void) |
Send a measure on communication line. More... | |
Variables | |
uint8_t | ieee11073_g_metadata_in [IEEE11073_LGT_METADATA_IN] |
uint8_t | ieee11073_g_metadata_out [IEEE11073_LGT_METADATA_OUT] |
uint8_t | ieee11073_g_opaquedata_in [IEEE11073_LGT_OPAQUEDATA_IN] |
uint8_t | ieee11073_g_opaquedata_out [IEEE11073_LGT_OPAQUEDATA_OUT] |
udi_phdc_metadata_t | ieee11073_g_phdc_metadata_in |
udi_phdc_metadata_t | ieee11073_g_phdc_metadata_out |
uint8_t | phd_assoc_req [] |
uint8_t | phd_attr [] |
uint8_t | phd_measure [] |
static uint8_t | udi_phdc_assoc_state |
#define IEEE11073_ASSOC_ABORT 0 |
Referenced by ieee11073_decode_metadata(), and ieee11073_sent().
#define IEEE11073_ASSOC_RUNNING 1 |
Referenced by ieee11073_decode_metadata(), ieee11073_send_association(), and ieee11073_sent().
#define IEEE11073_ASSOC_VALIDED 2 |
Referenced by ieee11073_decode_metadata(), ieee11073_send_mesure(), and ieee11073_skeleton_process().
#define IEEE11073_LGT_METADATA_IN 80 |
#define IEEE11073_LGT_METADATA_OUT 80 |
Referenced by ieee11073_enable_reception().
#define IEEE11073_LGT_OPAQUEDATA_IN 10 |
#define IEEE11073_LGT_OPAQUEDATA_OUT 10 |
Referenced by ieee11073_enable_reception().
|
static |
Start the data reception on communication line.
true | Metadata correct |
false | Metadata unknown |
References be16_to_cpu, IEEE11073_ASSOC_ABORT, IEEE11073_ASSOC_RUNNING, IEEE11073_ASSOC_VALIDED, ieee11073_sent(), if(), udi_phdc_metadata_t::metadata, udi_phdc_metadata_t::metadata_size, udi_phdc_metadata_t::opaque_size, phd_attr, udi_phdc_metadata_t::qos, udi_phdc_assoc_state, udi_phdc_senddata(), and USB_PHDC_QOS_MEDIUM_BEST.
Referenced by ieee11073_received().
|
static |
Start the reception of data on communication line.
true | Reception started |
false | Impossible to start reception |
References ieee11073_g_metadata_out, ieee11073_g_opaquedata_out, IEEE11073_LGT_METADATA_OUT, IEEE11073_LGT_OPAQUEDATA_OUT, ieee11073_received(), udi_phdc_metadata_t::metadata, udi_phdc_metadata_t::metadata_size, udi_phdc_metadata_t::opaque_size, udi_phdc_metadata_t::opaquedata, and udi_phdc_waitdata().
Referenced by ieee11073_received(), and ieee11073_skeleton_enable().
void ieee11073_received | ( | bool | status, |
uint16_t | nb_received | ||
) |
Callback called when a data is received.
nb_received | Number of data received |
References ieee11073_decode_metadata(), ieee11073_enable_reception(), and udi_phdc_metadata_t::metadata_size.
Referenced by ieee11073_enable_reception().
|
static |
References IEEE11073_ASSOC_RUNNING, ieee11073_sent(), udi_phdc_metadata_t::metadata, udi_phdc_metadata_t::metadata_size, udi_phdc_metadata_t::opaque_size, phd_assoc_req, udi_phdc_metadata_t::qos, udi_phdc_assoc_state, udi_phdc_senddata(), and USB_PHDC_QOS_MEDIUM_BEST.
Referenced by ieee11073_skeleton_enable().
|
static |
References IEEE11073_ASSOC_VALIDED, ieee11073_sent(), udi_phdc_metadata_t::metadata, udi_phdc_metadata_t::metadata_size, udi_phdc_metadata_t::opaque_size, phd_measure, udi_phdc_metadata_t::qos, udi_phdc_assoc_state, and udi_phdc_senddata().
Referenced by ieee11073_skeleton_send_measure_1(), and ieee11073_skeleton_send_measure_2().
void ieee11073_sent | ( | uint16_t | nb_send | ) |
Callback called when a data is sent.
nb_send | Number of data sent |
References IEEE11073_ASSOC_ABORT, IEEE11073_ASSOC_RUNNING, and udi_phdc_assoc_state.
Referenced by ieee11073_decode_metadata(), ieee11073_send_association(), and ieee11073_send_mesure().
void ieee11073_skeleton_disable | ( | void | ) |
Disable the communication model processing.
Referenced by main_phdc_disable().
bool ieee11073_skeleton_enable | ( | void | ) |
Enable the communication model processing.
true |
References ieee11073_enable_reception(), and ieee11073_send_association().
Referenced by main_phdc_enable().
bool ieee11073_skeleton_process | ( | void | ) |
Function to process communication model Must be scheduled by other process.
References IEEE11073_ASSOC_VALIDED, and udi_phdc_assoc_state.
Referenced by main().
void ieee11073_skeleton_send_measure_1 | ( | void | ) |
Send a measure on communication line.
References ieee11073_send_mesure(), and USB_PHDC_QOS_LOW_GOOD.
void ieee11073_skeleton_send_measure_2 | ( | void | ) |
Send a measure on communication line.
References ieee11073_send_mesure(), and USB_PHDC_QOS_MEDIUM_BETTER.
uint8_t ieee11073_g_metadata_in[IEEE11073_LGT_METADATA_IN] |
uint8_t ieee11073_g_metadata_out[IEEE11073_LGT_METADATA_OUT] |
Referenced by ieee11073_enable_reception().
uint8_t ieee11073_g_opaquedata_in[IEEE11073_LGT_OPAQUEDATA_IN] |
uint8_t ieee11073_g_opaquedata_out[IEEE11073_LGT_OPAQUEDATA_OUT] |
Referenced by ieee11073_enable_reception().
udi_phdc_metadata_t ieee11073_g_phdc_metadata_in |
udi_phdc_metadata_t ieee11073_g_phdc_metadata_out |
uint8_t phd_assoc_req[] |
Referenced by ieee11073_send_association().
uint8_t phd_attr[] |
Referenced by ieee11073_decode_metadata().
uint8_t phd_measure[] |
Referenced by ieee11073_send_mesure().
|
static |