Back to index

SendRCOMInCabFormMessage_v1

This function wraps the R:Com Database Stored Procedure EX_SendFormMessage. See R:COM Form Message Database API document for details.

Parameters:

[in] usn The user-name that you need to use to authenticate on this interface.
[in] pwd The password that you need to use to authenticate on this interface.
[out] errorMsg If an error happpens this string contains the error message. In case an error has happened (this variable contains a valid non-empty string) then the return value will not contain any usable data, do not try to parse it as an xml.
[in] options String parameter. This is currently unused and reserved for future versions of the API. Pass in an empty string.
[in] vehicleIDs Int array containing the IDs of the vehicles that should receive this message.
[in] userName The sender's name.
[in] msgTimeStamp Message timestamp. Please make sure that you specify the time in utc.
[in] formId ID of form definition.
[in] formVersion Version of form definition.
[in] formSchema Schema of form markup.
[in] messageBody The content of the message to be sent, marked up in XML as described by the R:COM Form Message Database API document. Please do not pass in plain text because it will not work.
return value If the errorMsg variable is null or empty then the returned string contains the result of the operation, per vehicle. The xml has the following structure:
<?xml version="1.0" encoding="utf-16"?>
<root>
<vehicles>
  <vehicle id="1" messageId="28" error="" />
  <vehicle id="2" messageId="29" error="" />
  <vehicle id="3" messageId="30" error="" />
  <vehicle id="200" messageId="" error="The INSERT statement conflicted with the FOREIGN KEY constraint" />
</vehicles>
</root>

Please note this.

Remarks

Minimum R-COM Database version

0.708

Some hints for sending a message

Use the GetVehicles_vX function to get a list of vehicle IDs; you can pass in one or more of them in the vehicleIDs parameter to this function. Use the GetFormDefinitions_vX function to get a list of forms; you can pass in the formId, formVersion and formSchema based on what this function returns. userName is a client specified string that appears as the sender in the message. msgTimeStamp will be used as the timestamp of the message.

For all the messages that were successfully saved to the outbox this function returns a message id. Please note that the fact that a message has been saved to the database does not mean that it will be surely delivered to the target device. Use the message ids in the returned xml to track what is happening to the message; you can retrieve the list of messages in the outbox and also their status via the GetRCOMInCabOutgoingFormMessages_vX function.

Error messages

Please see this page.