forked from alibaba/AliOS-Things
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:alibaba/AliOS-Things
- Loading branch information
Showing
45 changed files
with
912 additions
and
2,197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright (C) 2015-2017 Alibaba Group Holding Limited | ||
*/ | ||
|
||
#include "hw.h" | ||
#include "low_power.h" | ||
#include "linkwan.h" | ||
#include "timeServer.h" | ||
#include "version.h" | ||
#include "radio.h" | ||
#include "sx1276Regs-Fsk.h" | ||
#include "sx1276Regs-LoRa.h" | ||
#include "delay.h" | ||
|
||
#include "LoRaMac.h" | ||
#include "Region.h" | ||
#include "commissioning.h" | ||
|
||
#include <k_api.h> | ||
|
||
static void LoraTxData(lora_AppData_t *AppData); | ||
static void LoraRxData(lora_AppData_t *AppData); | ||
|
||
static LoRaMainCallback_t LoRaMainCallbacks = { | ||
HW_GetBatteryLevel, | ||
HW_GetUniqueId, | ||
HW_GetRandomSeed, | ||
LoraTxData, | ||
LoraRxData | ||
}; | ||
|
||
static void lora_task_entry(void *arg) | ||
{ | ||
lora_init(&LoRaMainCallbacks); | ||
lora_fsm(); | ||
} | ||
|
||
ktask_t g_lora_task; | ||
cpu_stack_t g_lora_task_stack[512]; | ||
int application_start( void ) | ||
{ | ||
krhino_task_create(&g_lora_task, "lora_task", NULL, | ||
5, 0u, g_lora_task_stack, | ||
512, lora_task_entry, 1u); | ||
} | ||
|
||
static void LoraTxData(lora_AppData_t *AppData) | ||
{ | ||
uint8_t index = 0; | ||
|
||
if (AppData->BuffSize < 1) { | ||
AppData->BuffSize = 1; | ||
} | ||
|
||
for (index = 0; index < AppData->BuffSize; index++) { | ||
AppData->Buff[index] = '0' + index; | ||
} | ||
DBG_LINKWAN("tx, port %d, size %d\r\n", AppData->Port, AppData->BuffSize); | ||
AppData->Port = LORAWAN_APP_PORT; | ||
} | ||
|
||
static void LoraRxData(lora_AppData_t *AppData) | ||
{ | ||
DBG_LINKWAN( "rx, port %d, size %d\r\n", AppData->Port, AppData->BuffSize); | ||
} |
10 changes: 5 additions & 5 deletions
10
example/lorawan/linklora/linklora.mk → example/lorawan/linkwan/linkwan.mk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.