Reading Buses API V3.0.0
A C#, .net Standard Library for the Reading Buses Open Data API (https://reading-opendata.r2p.com/), available to use in your C# console, WPF, UWP or Win Form Applications.
ReadingBusesAPI.JourneyDetails.LiveRecord Class Reference

Used to store information about a buses arrival at a bus stop. Mainly related to the "Stop Predictions" API. More...

Public Member Functions

BusStop GetOriginStop ()
 Gets the origin bus stop object. Null if unknown. More...
 
BusStop GetDestinationStop ()
 Gets the destination bus stop object. Null if unknown. More...
 
BusService Service ()
 Returns the related BusService Object for the Bus LiveRecord. More...
 
async Task< HistoricJourney[]> GetLiveJourneyData ()
 Gets live journey tracking information for this vehicle. More...
 
string DisplayTime ()
 Returns the number of min till bus is due in a min format. More...
 
double ArrivalMin ()
 Returns the number of min till the bus is due to arrive. More...
 

Package Functions

 LiveRecord ()
 The default constructor, used for XML parsing. More...
 

Static Package Functions

static LiveRecord[] GetLiveData (string actoCode)
 Gets a list of upcoming arrivals at a specific bus stop. Can throw an exception. More...
 

Package Attributes

string _destination
 The acto-code for the destination stop. More...
 
string _origin
 The acto-code for the origin stop. More...
 

Properties

string ServiceNumber [get, set]
 Holds the Service Number for the bus route. More...
 
string DestinationName [get, set]
 Holds the destination for the bus. More...
 
DateTime? ScheduledDeparture [get, set]
 Holds scheduled departure time of the bus at the location. More...
 
DateTime? ExpectedDeparture [get, set]
 Holds the estimated/ expected departure time of the bus, if Null no estimated time exists yet. More...
 
DateTime? ExpectedArrival [get, set]
 Holds the estimated/ expected arrival time of the bus, if Null no estimated time exists yet. More...
 
DateTime? ScheduledArrival [get, set]
 Holds the estimated/ expected arrival time of the bus, if Null no scheduled time exists. More...
 
Company OperatorCode [get, set]
 Holds the operator of the service. More...
 
string VehicleRef [get, set]
 Holds the Vehicles reference ID or number to identify it. More...
 

Detailed Description

Used to store information about a buses arrival at a bus stop. Mainly related to the "Stop Predictions" API.

Constructor & Destructor Documentation

◆ LiveRecord()

ReadingBusesAPI.JourneyDetails.LiveRecord.LiveRecord ( )
package

The default constructor, used for XML parsing.

Member Function Documentation

◆ ArrivalMin()

double ReadingBusesAPI.JourneyDetails.LiveRecord.ArrivalMin ( )

Returns the number of min till the bus is due to arrive.

Returns
The number of min till the bus is due to arrive.

◆ DisplayTime()

string ReadingBusesAPI.JourneyDetails.LiveRecord.DisplayTime ( )

Returns the number of min till bus is due in a min format.

Returns
The number of min until the bus is due to arrive in string format.

◆ GetDestinationStop()

BusStop ReadingBusesAPI.JourneyDetails.LiveRecord.GetDestinationStop ( )

Gets the destination bus stop object. Null if unknown.

Returns
Bus Stop for where this vehicle is destining.

◆ GetLiveData()

static LiveRecord[] ReadingBusesAPI.JourneyDetails.LiveRecord.GetLiveData ( string  actoCode)
staticpackage

Gets a list of upcoming arrivals at a specific bus stop. Can throw an exception.

Parameters
actoCodeThe Acto-code ID for a specific bus stop.
Returns
A list of Live Records containing details about upcoming buses.
Exceptions
ReadingBusesApiExceptionMalformedQueryThrown if no data is returned from the API.
ReadingBusesApiExceptionBadQueryThrown if you have used an invalid or expired API key or an invalid acto-code
ReadingBusesApiExceptionCriticalThrown if no error message or reasoning for fault is detectable.

◆ GetLiveJourneyData()

async Task< HistoricJourney[]> ReadingBusesAPI.JourneyDetails.LiveRecord.GetLiveJourneyData ( )

Gets live journey tracking information for this vehicle.

Returns
The live journey tracing information for this vehicle.

◆ GetOriginStop()

BusStop ReadingBusesAPI.JourneyDetails.LiveRecord.GetOriginStop ( )

Gets the origin bus stop object. Null if unknown.

Returns
Bus Stop for where this vehicle originated from.

◆ Service()

BusService ReadingBusesAPI.JourneyDetails.LiveRecord.Service ( )

Returns the related BusService Object for the Bus LiveRecord.

Returns
Information about the current bus service object.
Exceptions
InvalidOperationExceptionCan throw an exception if the service does not exists. This is however very unlikely, if this occurs there is an error in the API, not with your code.

Member Data Documentation

◆ _destination

string ReadingBusesAPI.JourneyDetails.LiveRecord._destination
package

The acto-code for the destination stop.

◆ _origin

string ReadingBusesAPI.JourneyDetails.LiveRecord._origin
package

The acto-code for the origin stop.

Property Documentation

◆ DestinationName

string ReadingBusesAPI.JourneyDetails.LiveRecord.DestinationName
getset

Holds the destination for the bus.

◆ ExpectedArrival

DateTime? ReadingBusesAPI.JourneyDetails.LiveRecord.ExpectedArrival
getset

Holds the estimated/ expected arrival time of the bus, if Null no estimated time exists yet.

◆ ExpectedDeparture

DateTime? ReadingBusesAPI.JourneyDetails.LiveRecord.ExpectedDeparture
getset

Holds the estimated/ expected departure time of the bus, if Null no estimated time exists yet.

◆ OperatorCode

Company ReadingBusesAPI.JourneyDetails.LiveRecord.OperatorCode
getset

Holds the operator of the service.

◆ ScheduledArrival

DateTime? ReadingBusesAPI.JourneyDetails.LiveRecord.ScheduledArrival
getset

Holds the estimated/ expected arrival time of the bus, if Null no scheduled time exists.

◆ ScheduledDeparture

DateTime? ReadingBusesAPI.JourneyDetails.LiveRecord.ScheduledDeparture
getset

Holds scheduled departure time of the bus at the location.

◆ ServiceNumber

string ReadingBusesAPI.JourneyDetails.LiveRecord.ServiceNumber
getset

Holds the Service Number for the bus route.

◆ VehicleRef

string ReadingBusesAPI.JourneyDetails.LiveRecord.VehicleRef
getset

Holds the Vehicles reference ID or number to identify it.


The documentation for this class was generated from the following file: