Code:
*
* ------ P2P Code Example --------
*
* Explanation: This example shows how to configure the module
* for P2P mode and the corresponding parameters. After this,
* the example shows how to receive packets from other radio modules
* which must be set with the same radio settings
*
* Copyright (C) 2015 Libelium Comunicaciones Distribuidas S.L.
* http://www.libelium.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Version: 0.3
* Design: David Gascon
* Implementation: Luismi Marti, Ruben Martin
*/
#include "arduPiLoRaWAN.h"
// socket to use
//////////////////////////////////////////////
uint8_t sock = SOCKET0;
//////////////////////////////////////////////
// define radio settings
//////////////////////////////////////////////
uint8_t power = 15;
uint32_t frequency = 868100000;
char spreading_factor[] = "sf12";
char coding_rate[] = "4/5";
uint16_t bandwidth = 125;
char crc_mode[] = "on";
uint8_t*buffer1[30];
uint16_t*size;
//////////////////////////////////////////////
// define functions
uint8_t radioModuleSetup(void);
// variable
uint8_t error;
void setup()
{
printf("Radio P2P example - Receiving packets\n\n");
// module setup
error = radioModuleSetup();
// Check status
if (error == 0)
{
printf("Module configured OK\n");
}
else
{
printf("Module configured ERROR\n");
}
}
void loop()
{
printf("\nListening to packets...\n");
// rx
error = LoRaWAN.receiveRadio(10000);
// Check status
if (error == 0)
{
printf("--> Packet received ");
printf("packet: %s\n", (char*) LoRaWAN._buffer);
printf("length: %u\n", LoRaWAN._length);
Utils.str2hex((char*)LoRaWAN._buffer, buffer1, sizeof(LoRaWAN._buffer));
printf("output ascii");
printf((char*)buffer1);
}
else
{
// error code
// 1: error
// 2: no incoming packet
printf("Error waiting for packets. error = %d\n", error);
}
}
can you tell me where is the error here and the compile tell me LoRaWAN_P2P_03_receive_packets2.cpp: In function ‘void loop()’:
LoRaWAN_P2P_03_receive_packets2.cpp:100:5: error: ‘Utils’ was not declared in this scope
Utils.str2hex((char*)LoRaWAN._buffer, buffer1, sizeof(LoRaWAN._buffer));