include: drivers: lora: Added support for RSSI and SNR in the recv API
Change the API to support RSSI, SNR of data received through lora_recv. Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
This commit is contained in:
parent
dbc1e717aa
commit
346e5c3a45
1 changed files with 5 additions and 3 deletions
|
@ -73,7 +73,7 @@ typedef int (*lora_api_send)(struct device *dev,
|
|||
* @see lora_recv() for argument descriptions.
|
||||
*/
|
||||
typedef int (*lora_api_recv)(struct device *dev, u8_t *data, u8_t size,
|
||||
s32_t timeout);
|
||||
s32_t timeout, s16_t *rssi, s8_t *snr);
|
||||
|
||||
struct lora_driver_api {
|
||||
lora_api_config config;
|
||||
|
@ -127,14 +127,16 @@ static inline int lora_send(struct device *dev,
|
|||
* @param timeout Timeout value in milliseconds. API also accepts, K_NO_WAIT
|
||||
for no wait time and K_FOREVER for blocking until
|
||||
data arrives.
|
||||
* @param rssi RSSI of received data
|
||||
* @param snr SNR of received data
|
||||
* @return Length of the data received on success, negative on error
|
||||
*/
|
||||
static inline int lora_recv(struct device *dev, u8_t *data, u8_t size,
|
||||
s32_t timeout)
|
||||
s32_t timeout, s16_t *rssi, s8_t *snr)
|
||||
{
|
||||
const struct lora_driver_api *api = dev->driver_api;
|
||||
|
||||
return api->recv(dev, data, size, timeout);
|
||||
return api->recv(dev, data, size, timeout, rssi, snr);
|
||||
}
|
||||
|
||||
#endif /* ZEPHYR_INCLUDE_DRIVERS_LORA_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue