API for linking to the Huxley National Rail REST proxy for the retrieval of live National Rail data. Still needs work (sadly), but works well for the time being!

Dependencies:   EthernetInterface

National Rail Huxley Integration Interface

This API provides a clear link between the National Rail Huxley Integration JSON interface (available at https://huxley.unop.uk/), and mbed devices, over an Ethernet connection. This project is still very much a work-in-progress, but hopefully I will be able to provide a comprehensive method of retrieving live National Rail departures data in a simple and effective way.

/media/uploads/Leigh_LbR/nre_powered_logo.jpg

Revision:
8:6e063a3827c0
Parent:
1:1de042ff6324
Child:
11:4532ff549fcf
diff -r d713a0e47ffe -r 6e063a3827c0 nr_network.cpp
--- a/nr_network.cpp	Tue Apr 26 13:03:09 2016 +0000
+++ b/nr_network.cpp	Thu May 05 14:52:33 2016 +0000
@@ -104,9 +104,10 @@
 }
 
 /*
- * Connect to the NR API.
+ * Connect to the Huxley (NR) API.
+ * @param url URL of the Huxley implementation to be used
  */
-int NR_Network_Conn::Connect()
+int NR_Network_Conn::Connect(const char* url)
 {
     if(_address[0] == '\0' && _sub_mask[0] == '\0' && _gateway == '\0') {
         if(conn.init() < 0) return -1;
@@ -118,7 +119,7 @@
     
     socket = TCPSocketConnection();
     
-    socket.connect("lbhuxley.azurewebsites.net", 80);
+    socket.connect(url, 80);
     
     return 0;
 }