OMA Client Configuration
OMA client has a number of configuration file projects should expect to adjust for project needs. Most of the files are in the ~/src/js/resources and ~/src/js/resources/config directories. Please review these directories for any project configuration settings you might like to change.
In addiction to the previously described configuration areas, there are some configuration topics to review based on your project needs.
Third Party Application Integration with the OMA Client
OMA supports one method to allow third party integration:
• HTTP Bridge for Windows 10 OMA clients and browser clients on a Windows 10 device.
Third Party Application Integration with localhost HTTP Bridge (Windows 10)
The OMA Windows 10 browser test applications support a localhost HTTP bridge URI integration scheme where other applications running on the OMA device can interact with the OMA application. This feature has been implemented using an HTTP server installed on the windows device running windows service that contains a server listening for requests from 3rd party apps and allowing OMA to pick up the request and process them.
On the Windows machine, you will need to install the OMA Bridge Service from the NMS SDK directory OMAHttpBridge.zip file. By default, the bridge app will start every time the system is rebooted; the user can use the Windows Service app to monitor and control (Start/Stop) the OMA Bridge Services. The Windows Event Viewer can also be used to view the log activity of the OMA Bridge in the Event Viewer, Applications and Services Logs, OMABrdg section.
The default port for the OMAHttpBridge is 9595. To change the port number, you will need to manually start the service with a single parameter: the desired port number.
Calls from the third party app would be as follows:
http://localhost:9595/oma/<command>
Where <command> would be some action OMA is prepared to do. For example:
http://localhost:9595/oma/mapfocus?lat=45.1272&long=-93.5023&zoom=12
Will return a json payload including the following information:
{
"omaStatus":"LoggedIn",
"omaRequest":"/oma/mapfocus?lat=45.1246&long=-93.5023&zoom=18",
"requestStatus":"queued"
}
The payload omaStatus will return LoggedIn, LoggedOut, or unknown. If OMA is not running or connected to the OMAHttpBridge, omaStatus will be unknown and OMA will not respond to the request. If OMA is connected to the bridge but not logged in, omaStatus will be LoggedOut and OMA will most likely not respond to the request.
Other commands supported by the OMAHttpBridge other than the http://localhost:9595/oma/ commands include:
http://localhost:9595/ - Which will return a status of the OMAHttpBridge:
{
"appName":"OMAHttpBridge",
"version":"16FEB2021-A",
"omaStatus":"LoggedIn",
"omaRequest":"/oma/mapfocus?lat=45.1269&long=-93.4994&zoom=18",
"requestStatus":"none",
"totalRequests":1083,
"omaRequests":15,
"omaGetRequests":1067
}
http://localhost:9595/getrequest: Which OMA uses to get the last requested oma command:
"omaRequest":"/oma/mapfocus?lat=45.1272&long=-93.5023&zoom=18"
}
http://localhost:9595/notloggedin: Which OMA uses to signal the user is not logged in to OMA.
http://localhost:9595/stop: Which can be used to terminate the OMAHttpBridge.
OMA will need to be configured to process /oma/ commands in the oma-main.js:: handleOpenURL function just as the Custom URI method used for Android and iOS devices; however, the invocation of these command will be directed to the Http Bridge as follows:
http://localhost:9595/oma/mapfocus?lat=123&long=456&msg=message
The OMA map page will open and focus on the latitude and longitude coordinates supplied by the lat and long parameters. Message passed in the msg parameter will be displayed to the user. If no message is passed, then an internally configured message will be displayed. Optional parameter, zoom, allows you to specify zoom level.
http://localhost:9595/oma/crewstatus?status=ONS&event=123
Status of the crew associated with the OMA user will be set to the value specified by the status parameter (valid values: ASN, ENR, ONS, SUS, CNL, INC) with respect to the event specified by the event parameter. Crew status will only be updated in OMA; it will not be sent to NMS. The statuses that OMA will allow another application to use must be configured in the src/js/resources/config/tasks.js file in the following value:
// crew event statuses that are allowed to be set by external app self.allowed_external_task_statuses = ['ASN', 'ENR', 'ONS', 'SUS', 'CNL', 'INC'];
http://localhost:9595/oma/open?page=switching&id=123
Opens OMA screen specified by the page parameter (valid values: switching, task). If the id parameter is provided, then details for the specific switching sheet or task will be displayed.
http://localhost:9595/oma/getinfo?type=event&id=123&responseurl=otherapp://data?cause={cause}
This request allows other applications to retrieve information from OMA. Parameter type specifies the type of the object from where information will be retrieved (valid values: event). Parameter id specifies the object identifier. Parameter responseurl contains template for the custom URL that will be used to deliver response to the other app. Template parameters enclosed in {} will be substituted with data values. If OMA is requested to navigate to a different screen when there are unsaved changes, the user will be prompted to save the changes, discard them, or ignore the navigation request.