Libelium Comunicaciones Distribuidas S.L. PARKING-V1 Manuel D’Utilisation

Page de 67
-56-
Services
12.5. Saving the information received
This section explains how to get the information sent by the Smart Parking nodes to the callback server.
7KHVHUYLFHVLPSOHPHQWHGE\/LEHOLXPORJWKHLQIRUPDWLRQLQDȴOHE\GHIDXOW7RVDYHWKHLQIRUPDWLRQLQDGDWDEDVH
RUDFORXGVHUYLFHIROORZLQJȴOHVLQFKDUJHRIGRLQJWKHRSHUDWLRQVGHVFULEHGLQWKHFDOOEDFNVHUYHUQHHGWREH
PRGLȴHG
 
Sigfox: your_callback_server_path/services/sigfox/index.php
 
Loriot: your_callback_server_path/services/loriot/websocket_response.php
 
Actility: your_callback_server_path/services/actility/index.php
your_callback_server_path  has  to  be  replaced  with  the  path  where  the    callback  server  was  previously  installed. 
6HDUFKIRUDFRPPHQWOLQHOLNHWKLVLQWKHSUHYLRXVVRXUFHFRGHȴOHV
//To-Do: get the information received: $frame->get_data();
([DPSOHWRVDYHWKHLQIRUPDWLRQLQD0\64/GDWDEDVHXVLQJWKH3+33'2OLEUDU\
$data = $frame->get_data();
OLQN QHZ3'2ߕP\VTOKRVW VHUYHUSRUW SRUWGEQDPH GEQDPHFKDUVHW XWIߖߕXVHUߖߕSDV-
sword’);
VWDWHPHQW OLQN!SUHSDUHߙ,16(57,172WDEOHࢱHOGࢱHOG9$/8(6GDWDGDWDߚ
$statement->execute(array(
ߙGDWDߚ !GDWD>ߕSDUNLQJߖ@
ߙGDWDߚ !GDWD>ߕEDWWHU\ߖ@
));
It is recommended to paste this code block below the commented line.
Take a close look at the next section in order to get more information about all the data obtained using the 
get_
data
 method.
12.6. How to develop a new service
ΖWLVSRVVLEOHWRGHYHORSDQHZVHUYLFHGL΍HUHQWWRWKHVHUYLFHVSURYLGHGE\/LEHOLXP7KHDLPRIDVHUYLFHLVWR
get the payload sent from the Smart Parking nodes and generate the correct answer when it is needed. Both, the 
SD\ORDGDQGWKHDQVZHUKDYHWREHGHFRGHGDFFRUGLQJWR/LEHOLXPVSHFLȴFDWLRQV
(DFKVHUYLFHFDQKDYHLWVRZQIXQFWLRQDOLW\VRPHZLOOUHTXLUHDZHEVRFNHWVRPHD85/WRFDOOȐ7KHVSHFLȴFDWLRQV
of the new service should include all the information needed to implement the new service. We recommend to 
use PHP, so the new project could be developed faster reusing code created. The most useful PHP class is called 
frame, which has been created to simplify the payload-answer process and it is located in:
your_callback_server_path/includes/class.Frame.php
“your_callback_server_path” has to be replaced with the path where the user has the callback server installed. 
This is a complete description of all attributes and methods of the class frame:
Attributes
Name
Description
private String data
Information received from the node.
private String type
Frame type decoded from the information sent from the node.
private String return
String to return to the node.
private String device_id
Device ID of the node.
private Array bytes
Information received from the node converted into bytes.
private Array bits
Array in which each previous byte is converted into bits.
private Array info
Array with the information decoded.