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.
Diff: arrival.h
- Revision:
- 7:d713a0e47ffe
- Parent:
- 3:a287e75a2121
diff -r dae1cdf19e90 -r d713a0e47ffe arrival.h --- a/arrival.h Mon Apr 25 14:41:42 2016 +0000 +++ b/arrival.h Tue Apr 26 13:03:09 2016 +0000 @@ -29,5 +29,22 @@ * @param _operatorCode The train operating companies' NR code */ Arrival(const std::string& _crs, const std::string& _locationName, const std::string& _sta, const std::string& _eta, const std::string& _platform, const std::string& _operatorName, const std::string& _operatorCode); + + /** Determine if the arrival is delayed + * @return a boolean stating if the arrival is delayed + */ + bool IsDelayed(); + /** Determine if a arrival is cancelled + * @return a boolean stating if the arrival is cancelled + */ + bool IsCancelled(); + /** Determine if a arrival is on time + * @return a boolean stating if the arrival is on time + */ + bool IsOnTime(); + /** Get the estimated time of arrival + * @return a time string with the estimated time of arrival (in format "HH:MM"), the phrase "Unknown" if it is not known, or the phrase "Cancelled" if it is cancelled + */ + std::string GetETAFormatted(); }; #endif \ No newline at end of file