Move pktGetServiceObject function from header to implementation code

pull/4/head
bob 2018-08-11 01:23:54 +10:00
rodzic bce5a30d75
commit 2e10459cb0
2 zmienionych plików z 34 dodań i 32 usunięć

Wyświetl plik

@ -1079,4 +1079,37 @@ void pktCallbackManagerRelease(packet_svc_t *handler) {
chThdWait(handler->cb_terminator);
}
/**
* @brief Gets service object associated with radio.
*
* @param[in] radio radio unit ID.
*
* @return pointer to the service object.
* @retval NULL If the radio ID is invalid or no service object assigned.
*
* @api
*/
packet_svc_t *pktGetServiceObject(radio_unit_t radio) {
/*
* Get radio configuration object.
*/
const radio_config_t *data = pktGetRadioData(radio);
chDbgAssert(data != NULL, "invalid radio ID");
if(data == NULL)
return NULL;
/*
* Get packet handler object for this radio.
*/
packet_svc_t *handler = data->pkt;
/* if(radio == PKT_RADIO_1) {
handler = &RPKTD1;
}*/
chDbgAssert(handler != NULL, "invalid radio packet driver");
return handler;
}
/** @} */

Wyświetl plik

@ -259,6 +259,7 @@ extern "C" {
void pktReleasePacketBuffer(packet_t pp);
dyn_semaphore_t *pktInitBufferControl(void);
void pktDeinitBufferControl(void);
packet_svc_t *pktGetServiceObject(radio_unit_t radio);
#ifdef __cplusplus
}
#endif
@ -556,38 +557,6 @@ static inline bool pktGetAX25FrameStatus(pkt_data_object_t *object) {
return (object->status & (STA_PKT_INVALID_FRAME | STA_PKT_CRC_ERROR)) == 0;
}
/**
* @brief Gets service object associated with radio.
*
* @param[in] radio radio unit ID.
*
* @return pointer to the service object.
* @retval NULL If the radio ID is invalid or no service object assigned.
*
* @api
*/
inline packet_svc_t *pktGetServiceObject(radio_unit_t radio) {
/*
* Get radio configuration object.
*/
const radio_config_t *data = pktGetRadioData(radio);
chDbgAssert(data != NULL, "invalid radio ID");
if(data == NULL)
return NULL;
/*
* Get packet handler object for this radio.
*/
packet_svc_t *handler = data->pkt;
/* if(radio == PKT_RADIO_1) {
handler = &RPKTD1;
}*/
chDbgAssert(handler != NULL, "invalid radio packet driver");
return handler;
}
/**
* @brief Gets current state of a packet service..
*