Introduction
This page describes the APIs exposed by the Milli Manufacturing Tools application, including Milli Personalization, RMA Test, and Draw Test APIs. An Itron Partner can build their own custom applications by integrating with these APIs. For related information about the Reporting Module APIs , see here.
This page contains the following sections:
- Prerequisites
- Milli Personalization APIs
- Properties
- Methods
- Events
- Sysvars
- Sample Code
- RF Test API
- Command Class Methods
- Command Class Events
- ResponseAnalyzer Class Events
- Draw Test API
- DrawTestCommand Class Methods
- DrawTestCommand Class Events
Prerequisites
The Milli Manufacturing Tools Application is a C#/.NET based application that requires Visual Studio IDE for development. To view the APIs and use them in a custom application, use the following steps to install Visual Studio Community on your development machine.
- Download Visual Studio Community, double-click on the installer, and follow the steps to install.
- Select .Net Desktop Development and click Install. See the following image for reference.
Milli Personalization APIs
The Personalization APIs (PersonalizationBase and WiredPersonalization) are a set of .NET classes with a common Personalization Base class. The following combination of properties and methods provides the personalization feature:
Properties
- ComPort – COM port representing the debug UART or the FSU
- ConfigPath – File path for the Regional/Personalization Config to be applied to the Milli device
Methods
- ApplyConfiguration – Applies the contents of ConfigScript to the UUT
- ConfigScript – Deserializes the file referenced by ConfigPath
- ValidateConfiguation – Validates the script referenced by ConfigPath, and sets ConfigScript
- VerifyPersonalization – Verifies the settings applied on the Milli
Events
- OnError – When there is an error to be raised, registers a callback method with OnError of WiredPersonalization class
- ConfigProcess – Raises after getting a response from Milli for each sysvar command
- OnResetMilli – Raises to notify the user when the calling application needs to restart Milli manually
- OnPersonalizationComplete – Raises after successful personalization of Milli
Properties
The following section describes the available configurable properties associated with the Milli Manufacturing Tools App.
COMPort
Signature: public string ComPort { get; set; } –
This property is used to set COM Port name on which Milli is connected through UART cable.
ConfigPath
Signature: public string ConfigPath { get; set; }
This property is used to set metadata JSON file path
Methods
The following section describes the available configurable methods associated with the Milli Manufacturing Tools App.
ApplyConfiguration
This method writes the sysvars on to Milli based on the metadata JSON values. This method takes a CancellationToken as an optional parameter. This token is used to cancel personalization process from UI/reference app.
Signature: public void ApplyConfiguration(CancellationToken ct)
ValidateConfiguration
This method reads the metadata JSON from the provided configuration path and validates it to confirm that metadata JSON is well formed. After validating metadata JSON, the Milli Personalization library de-serializes the JSON and prepares commands based on the sysvar value provided in metadata JSON.
Signature: public void ValidateConfiguration()
VerifyPersonalization
This method verifies the sysvars which have been written onto Milli. This API should be called on ‘OnPersonalizationComplete’ event, using the same personalization object.
Signature: public bool VerifyPersonalization();
Events
The WiredPersonalization class exposes the following events. The calling application can register a call back method and invoke the events.
OnError
This event is raised if there is an error occurred on any command execution, and registers a callback method with OnError of WiredPersonalization class.
Create an object of WiredPersonalization class to access OnError event and register the call back method.
Implement the call back method and access the error as e.Message where ConfigProgressArgs
is a sample Class.
ConfigProgress
This event is raised after getting a response from Milli for each sysvar command. Register a handler if you want to capture this event while processing each sysvar.
Create an object of WiredPersonalization class to access ConfigProgress event and register the event handler.
Implement the handler method and access the Result as e.Message where ConfigProgressArgs is a Class.
OnResetMilli
This event is raised to notify the user when the calling application needs to restart Milli manually.
Create an object of WiredPersonalization class to access OnResetMilli event and register the event handler
Implement the handler and intimate user to restart Milli by displaying any message or pop up box.
OnPersonalizationComplete
This event is raised after successful personalization of Milli. To acess OnPersonalization Colmplete event and register the event handler, create an object of WiredPersonalization class.
Implement the handler method which executes when the personalization process is completed successfully.
Sysvars
Following are the Sysvars supported by the PersonalizationBase API :
- Sysvar1 – Network ID Pan ID (from config file)
- Sysvar3 – Country code (from config file)
- Sysvar7 - Routing Message Timing (hardcode to value ‘~’)
- Sysvar8 – Operating mode (hardcode to value ‘~’)
- Sysvar20 – Device Type (from config file)
- Sysvar26 – MLMEKNOB1 (hardcode to value ‘4=0x00 0x00 0x2a 0x03’)
- Sysvar27 – MLMEKNOB2 (hardcode to value ‘4=0x00 0x00 0x79 0x00’)
- Sysvar29 – MLMEKNOB4 (hardcode to value ‘4=0x00 0x00 0x60 0x54’)
- Sysvar34 – Listening Duration (hardcode to value ‘2=0x54 0x06’)
- Sysvar35 – Persistent Observe (from config file)
- Sysvar39 – Trap ID (from config file)
- Sysvar41- Device IC Reboot (from config file)
Sample Code
The following code snippet is a sample usage of the WiredPersonalization class library. This code is meant to be used as an example and should be modified according to the specific use case to be implemented.