Commit edb85a0c authored by Guillaume Gonnet's avatar Guillaume Gonnet
Browse files

Orange provider is now working!

parent e1a249c7
......@@ -21,7 +21,7 @@ This project is under the MIT license
// TMP: send a ping message.
static void send_message(void)
{
bm_encode_payload(9, 4, 0);
bm_encode_payload(9, 2, 1);
puts("Sending message ...");
pvd_send(&pvd_orange_cmd, &bm_payload);
......@@ -45,6 +45,7 @@ int main(void)
// pvd_reset_all();
#endif
return 0;
// xtimer_sleep(10);
uint32_t start = xtimer_now_usec();
......
......@@ -39,6 +39,17 @@ static const pvd_otta_t orange_cmd_otta = {
const provider_t pvd_orange_cmd = PVD_IMPLEM_OTAA(orange_cmd_otta);
// Campus IOT provider (using OTAA).
static const pvd_otta_t campus_otta = {
EEPROM_CAMPUS_OTAA,
CAMPUS_IOT_DEVEUI,
CAMPUS_IOT_APPEUI,
CAMPUS_IOT_APPKEY
};
const provider_t pvd_campus_otaa = PVD_IMPLEM_OTAA(campus_otta);
// TTN provider (for benchmark).
static const pvd_ttn_t ttn_bm_ttn = {
EEPROM_TTN_BM, TTN_BM_COUNT,
......@@ -53,8 +64,8 @@ const provider_t pvd_ttn_bm = PVD_IMPLEM_TTN(ttn_bm_ttn);
// All defined providers.
static const provider_t *pvd_all[] = {
&pvd_orange_bm,
//&pvd_orange_cmd,
//&pvd_orange_bm,
&pvd_orange_cmd,
&pvd_ttn_bm
};
......
......@@ -68,6 +68,9 @@ void pvd_ttn_reset(const provider_t *pvd);
extern const provider_t pvd_orange_bm;
extern const provider_t pvd_orange_cmd;
// Campus IOT providers.
extern const provider_t pvd_campus_otaa;
// TTN provider.
extern const provider_t pvd_ttn_bm;
......
......@@ -18,6 +18,7 @@ OTAA join cache takes 32 bytes + 4 bytes for the frame counter.
// EEPROM space for join cache (36 bytes).
#define EEPROM_ORANGE_BM 0
#define EEPROM_ORANGE_CMD 36
#define EEPROM_CAMPUS_OTAA 72
// EEPROM space for TTN.
#define EEPROM_TTN_BM 72
#define EEPROM_TTN_BM 108
......@@ -14,13 +14,17 @@ This project is under the MIT license
#define ORANGE_BM_APPKEY { 0x4B, 0x20, 0xEF, 0x23, 0xB1, 0xC3, 0xA9, 0x39, 0x3F, 0x03, 0x4F, 0x65, 0x27, 0xCA, 0x71, 0xF2 }
// Orange provider for command.
// #define ORANGE_CMD_DEVEUI { 0x18, 0xC0, 0x81, 0xB5, 0x70, 0x9C, 0x54, 0x55 }
// #define ORANGE_CMD_APPEUI { 0x90, 0x5C, 0x55, 0x55, 0xC7, 0xCD, 0x88, 0xBE }
#define ORANGE_CMD_DEVEUI { 0x19, 0xC0, 0x81, 0xB5, 0x70, 0x9C, 0x54, 0x55 }
#define ORANGE_CMD_APPEUI { 0x91, 0x5C, 0x55, 0x55, 0xC7, 0xCD, 0x88, 0xBE }
#define ORANGE_CMD_DEVEUI { 0x18, 0xC0, 0x81, 0xB5, 0x70, 0x9C, 0x54, 0x55 }
#define ORANGE_CMD_APPEUI { 0x90, 0x5C, 0x55, 0x55, 0xC7, 0xCD, 0x88, 0xBE }
#define ORANGE_CMD_APPKEY { 0x08, 0xAC, 0xA9, 0x4C, 0xA5, 0xFD, 0x3E, 0xF1, 0x11, 0x9D, 0x7B, 0x73, 0x5E, 0xE7, 0x3D, 0x5A }
// Campus IOT (using OTAA).
#define CAMPUS_IOT_DEVEUI { 0x19, 0xC0, 0x81, 0xB5, 0x70, 0x9C, 0x54, 0x55 }
#define CAMPUS_IOT_APPEUI { 0x19, 0xC0, 0x81, 0xB5, 0x70, 0x9C, 0x54, 0x55 }
#define CAMPUS_IOT_APPKEY { 0x08, 0xAC, 0xA9, 0x4C, 0xA5, 0xFD, 0x3E, 0xF1, 0x11, 0x9D, 0x7B, 0x73, 0x5E, 0xE7, 0x3D, 0x5A }
// TTN provider for benchmark.
#define TTN_BM_DEVADDR 0x26019200
#define TTN_BM_COUNT 256
......
......@@ -17,7 +17,7 @@ LGPLv2.1 license.
#include <msg.h>
#include <net/netdev.h>
#define ENABLE_DEBUG (0)
#define ENABLE_DEBUG (1)
#include <debug.h>
......
......@@ -102,13 +102,11 @@ int lorariot_send(const lorariot_mcps_t *mcps)
{
// Call `LoRaMacMcpsRequest` in event loop thread.
lorariot_call((lorariot_func_t)_send_mcps, (void *)mcps);
DEBUG("[lorariot] MCPS call requested!\n");
// Wait for TX status information from LoRaMAC-node.
msg_t msg;
msg_receive(&msg);
DEBUG("[lorariot] MCPS requested!\n");
return msg.content.value;
}
......@@ -118,7 +116,6 @@ int lorariot_waitsend(void)
{
lorariot.caller_pid = thread_getpid();
DEBUG("[lorariot] Wait for confirm!\n");
msg_t msg;
msg_receive(&msg);
return msg.content.value;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment