HowTo Use Software Content Management (SCM) with the .NET SDK
It would appear that the necessary building blocks are available in the .NET SDK to support SCM. However, I have not been able to pick apart the back-and-forth interactions between the .NET SDK Gateway I have built and ThingWorx to get a firmware update to occur. It would be very helpful to have a description/tutorial that describes what is necessary on the SDK-side of implementing support for SCM.
Here is what I can see:
- The TriggerUpdateAction() service in my FileTransferVirtualThing-based object is getting invoked with a 'start' action. The params JSON object, however, is null even though I can see data in the logs.
- I'm guessing that a FileTransfer event would need to be fired from the FileTransferVirtualThing to ThingWorx to indicate progress/failure
- The ScheduleDownload() and ScheduleInstall() services in the FileTransferVirtualThing play some role in processing, but I'm not sure what event I need to pass back to get them invoked.
At this point, I have the following TriggerUpdateAction signature which I doubt is entirely correct due to the fact that the params are null (note that the variable name is not 'params' because it is a reserved word in C#)
[method: ThingworxServiceDefinition(name = "TriggerUpdateAction", description = "Start the process")]
[return: ThingworxServiceResult(name = CommonPropertyNames.PROP_RESULT, description = "", baseType = "NOTHING")]
public void TriggerUpdateAction([ThingworxServiceParameter(name = "action", baseType = "STRING")] string action,
[ThingworxServiceParameter(name = "params", baseType = "JSON")] string parms)
{
Console.WriteLine("Triggering update {0}", action);
}
Information visible in the logs during when TriggerUpdateAction is called:
[Verbose] Recv'd Msg <<<<<<<<< Message Details: Version: 1 Method/Code: 0x3 (POST) RequestID: 1215754 EndpointID:-1 SessionID: -1 Multipart: 0 EntityType: THING EntityName: SDKThing CharacteristicType: SERVICES CharateristicName: TriggerUpdateAction Parameter Type: INFOTABLE DataShape: Name: action BaseType: STRING Name: params BaseType: JSON Row 1: BaseType: STRING Value: start Length: 5 BaseType: JSON Value: {"path":"/cdemo1_1521222770144.zip","deploymentInstallTimeout":7200000,"downloadDate":1521224686809,"installDate":1521224687809,"name":"DevPortalPackage","updateManager":"TW.RSM.SFW.SoftwareManager","id":"ac07310f-6b79-49e6-8e3a-b9a091552d1f","repository":"TW.RSM.Thing.FileRepository","script":"install.lua"} Length: 309

