mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 09:21:12 +03:00
GPRS: Remove Grove Dependency
Signed-off-by: Abhishek Malik <abhishek.malik@intel.com>
This commit is contained in:
@ -213,7 +213,7 @@ add_example (loudness)
|
||||
add_example (mg811)
|
||||
add_example (wheelencoder)
|
||||
add_example (sm130)
|
||||
add_example (grovegprs)
|
||||
add_example (gprs)
|
||||
add_example (lm35)
|
||||
add_example (micsv89)
|
||||
add_example (xbee)
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include <iostream>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include "grovegprs.hpp"
|
||||
#include "gprs.hpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace upm;
|
||||
@ -48,7 +48,7 @@ void printUsage(char *progname)
|
||||
}
|
||||
|
||||
// simple helper function to send a command and wait for a response
|
||||
void sendCommand(upm::GroveGPRS* sensor, string cmd)
|
||||
void sendCommand(upm::GPRS* sensor, string cmd)
|
||||
{
|
||||
// commands need to be terminated with a carriage return
|
||||
cmd += "\r";
|
||||
@ -71,8 +71,8 @@ int main(int argc, char **argv)
|
||||
{
|
||||
//! [Interesting]
|
||||
|
||||
// Instantiate a GroveGPRS Module on UART 0
|
||||
upm::GroveGPRS* sensor = new upm::GroveGPRS(0);
|
||||
// Instantiate a GPRS Module on UART 0
|
||||
upm::GPRS* sensor = new upm::GPRS(0);
|
||||
|
||||
// Set the baud rate, 19200 baud is the default.
|
||||
if (sensor->setBaudRate(19200) != mraa::SUCCESS)
|
||||
@ -108,4 +108,4 @@ int main(int argc, char **argv)
|
||||
|
||||
delete sensor;
|
||||
return 0;
|
||||
}
|
||||
}
|
@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
var sensorObj = require('jsupm_grovegprs');
|
||||
var sensorObj = require('jsupm_gprs');
|
||||
|
||||
|
||||
/************** Functions **************/
|
||||
@ -57,8 +57,8 @@ function sendCommand(sensor, cmd, callback)
|
||||
}
|
||||
|
||||
/************** Main code **************/
|
||||
// Instantiate a GROVEGPRS Module on UART 0
|
||||
var sensor = new sensorObj.GroveGPRS(0);
|
||||
// Instantiate a GPRS Module on UART 0
|
||||
var sensor = new sensorObj.GPRS(0);
|
||||
|
||||
// Set the baud rate, 19200 baud is the default.
|
||||
if (sensor.setBaudRate(19200))
|
||||
@ -70,7 +70,7 @@ if (sensor.setBaudRate(19200))
|
||||
printUsage(process.argv[1]);
|
||||
|
||||
// Note: in nodeJS, command-line argument 0 is "node".
|
||||
// Command-line argument 1 is "grovegprs.js"
|
||||
// Command-line argument 1 is "gprs.js"
|
||||
// If you have a third argument, then it's a command
|
||||
if (process.argv.length > 2)
|
||||
{
|
@ -22,10 +22,10 @@
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
import time, sys, signal, atexit
|
||||
import pyupm_grovegprs as sensorObj
|
||||
import pyupm_gprs as sensorObj
|
||||
|
||||
# Instantiate a GroveGPRS Module on UART 0
|
||||
sensor = sensorObj.GroveGPRS(0)
|
||||
# Instantiate a GPRS Module on UART 0
|
||||
sensor = sensorObj.GPRS(0)
|
||||
|
||||
## Exit handlers ##
|
||||
# This stops python from printing a stacktrace when you hit control-C
|
Reference in New Issue
Block a user