Implement RADIO_CONST_MAX_PAYLOAD_LEN: nullradio
#include "dev/nullradio.h"
-
-
+/*---------------------------------------------------------------------------*/
+/*
+ * The maximum number of bytes this driver can accept from the MAC layer for
+ * "transmission".
+ */
+#define MAX_PAYLOAD_LEN ((unsigned short) - 1)
/*---------------------------------------------------------------------------*/
static int
init(void)
@@ -66,8 +70,18 @@ off(void)
static radio_result_t
get_value(radio_param_t param, radio_value_t *value)
{
+ if(!value) {
+ return RADIO_RESULT_INVALID_VALUE;
+ }
+
+ switch(param) {
+ case RADIO_CONST_MAX_PAYLOAD_LEN:
+ *value = (radio_value_t)MAX_PAYLOAD_LEN;
+ return RADIO_RESULT_OK;
+ default:
return RADIO_RESULT_NOT_SUPPORTED;
}
+}
/*---------------------------------------------------------------------------*/
static radio_result_t
set_value(radio_param_t param, radio_value_t value)
