User's Manual

-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.
7KHVHUYLFHVLPSOHPHQWHGE\/LEHOLXPORJWKHLQIRUPDWLRQLQDȴOHE\GHIDXOW7RVDYHWKHLQIRUPDWLRQLQDGDWDEDVH
RUDFORXGVHUYLFHIROORZLQJȴOHVLQFKDUJHRIGRLQJWKHRSHUDWLRQVGHVFULEHGLQWKHFDOOEDFNVHUYHUQHHGWREH
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.
6HDUFKIRUDFRPPHQWOLQHOLNHWKLVLQWKHSUHYLRXVVRXUFHFRGHȴOHV
//To-Do: get the information received: $frame->get_data();
([DPSOHWRVDYHWKHLQIRUPDWLRQLQD0\64/GDWDEDVHXVLQJWKH3+33'2OLEUDU\
$data = $frame->get_data();
OLQN QHZ3'2ߕP\VTOKRVW VHUYHUSRUW SRUWGEQDPH GEQDPHFKDUVHW XWIߖߕXVHUߖߕSDV-
sword’);
VWDWHPHQW OLQN!SUHSDUHߙ,16(57,172WDEOHࢱHOGࢱHOG9$/8(6GDWDGDWDߚ
$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
ΖWLVSRVVLEOHWRGHYHORSDQHZVHUYLFHGL΍HUHQWWRWKHVHUYLFHVSURYLGHGE\/LEHOLXP7KHDLPRIDVHUYLFHLVWR
get the payload sent from the Smart Parking nodes and generate the correct answer when it is needed. Both, the
SD\ORDGDQGWKHDQVZHUKDYHWREHGHFRGHGDFFRUGLQJWR/LEHOLXPVSHFLȴFDWLRQV
(DFKVHUYLFHFDQKDYHLWVRZQIXQFWLRQDOLW\VRPHZLOOUHTXLUHDZHEVRFNHWVRPHD85/WRFDOOȐ7KHVSHFLȴ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.