Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: pulga-lorawan-drv SX1272
Diff: lora.cpp
- Revision:
- 16:3994aadbb37c
- Parent:
- 14:88373765b9a9
- Child:
- 17:61e9a2208fac
--- a/lora.cpp Thu Apr 29 16:54:10 2021 +0000
+++ b/lora.cpp Fri Apr 30 13:46:57 2021 +0000
@@ -170,7 +170,7 @@
sx1272.writeRegister(REG_OP_MODE,133); //leitura continua
cont++;
}
-void send_msg(char *msg_lora) //data predefined
+void send_msg(char *msg_lora, uint8_t msg_len) //data predefined
{
led1=1;
led2=1;
@@ -179,7 +179,7 @@
//send_packet((uint8_t*)msg_lora,strlen(msg_lora));
//pc.printf("packet send :\n%s\nrsize=%d\n",msg_lora, strlen(msg_lora));
//sx1272.sendPacketTimeout(DEFAULT_DEST_ADDR,/* (uint8_t*)*/msg_lora, strlen(msg_lora));
- r_size=sprintf((char*)message,msg_lora);
+ r_size=msg_len; //sprintf((char*)message,msg_lora);
pc.printf("packet send :\n%s\nrsize=%d\n",message,r_size);
send_packet(message,r_size);
@@ -208,6 +208,7 @@
buffer[i]=sx1272.readRegister(REG_FIFO);
/* if (buffer[i]== '\n') printf(" \\n");
if (buffer[i]== 0x0B) printf("tab");*/
+ //pc.printf("%d=",i);
pc.printf("%c",buffer[i]);//print packet
}
pc.printf(">\n");