Overview
This Tutorial provides a walk-through of available APIs to perform End Point Configuration operation using MAUI RFID SDK
This Feature is supported only with RFD40XX/90XX premium and premium plus devices.
Create The Project
- Start by creating a new project in Visual Studio. For help, see the Create Project.
- Refer Hello RFID to prepare basic setup to work with RFID Reader and then follow this guide
Saving new or Updating End Point Configuration
The application can call method Reader.Config.SetEndpointConfiguration to save a new or update the existing end point configuration.
public void setEndPointConfiguration(string name, ENUM_EP_TYPE type, ENUM_EP_OPERATION operation, ENUM_EP_PROTOCOL_TYPE protocol,
string url, int port, int keepAlive, string tenantId, boolean cleanSession,
int minReconnectDelay, int maxReconnectDelay, ENUM_HOST_VERIFY hostVerify, string userName,
string password, string caCertName, string certName, string keyName, string cmdTopic,
string responseTopic, string eventTopic) {
try {
EndpointConfigurationInfo _endpointConfigurationInfo = new EndpointConfigurationInfo();
_endpointConfigurationInfo.Epname = name;
_endpointConfigurationInfo.Type = type;
_endpointConfigurationInfo.Operation = operation; //NEW OR UPDATE enum values based on Use case
_endpointConfigurationInfo.Protocol = protocol;
_endpointConfigurationInfo.Url = url;
_endpointConfigurationInfo.Port = port;
_endpointConfigurationInfo.Keepalive = keepAlive;
_endpointConfigurationInfo.Tenantid = tenantId;
if(cleanSession) {
_endpointConfigurationInfo.Encleanss = true;
_endpointConfigurationInfo.Dscleanss = false;
} else {
_endpointConfigurationInfo.Encleanss = false;
_endpointConfigurationInfo.Dscleanss = true;
}
_endpointConfigurationInfo.Rcdelaymin = minReconnectDelay;
_endpointConfigurationInfo.Rcdelaymax = maxReconnectDelay;
_endpointConfigurationInfo.Hostvfy = hostVerify;
_endpointConfigurationInfo.Username = userName;
_endpointConfigurationInfo.Password = password;
/* Start of ENUM_EP_TYPE.MDM Type only params */
_endpointConfigurationInfo.Cacertname = caCertName;
_endpointConfigurationInfo.Certname = certName;
_endpointConfigurationInfo.Keyname = keyName;
_endpointConfigurationInfo.Subname = cmdTopic;
_endpointConfigurationInfo.Pub1name = responseTopic;
_endpointConfigurationInfo.Pub2name = eventTopic;
/* End of ENUM_EP_TYPE.MDM Type only params */
RFIDResults result = reader.Config.SetEndpointConfiguration(_endpointConfigurationInfo);
/* Below Code is to Save the above submitted Configuration */
EndpointConfigurationInfo saveEPConfig = new EndpointConfigurationInfo();
saveEPConfig.Operation = ENUM_EP_OPERATION.Save;;
result = Reader.Config.SetEndpointConfiguration(_endpointConfigurationInfo);
}catch (InvalidUsageException | OperationFailureException e) {
e.printStackTrace(); // Failure Cases Throws exception
}
}
Fetch All Saved End point Configuration Names
The application can call method Reader.Config.EndpointNames to get the list of previously saved configuration names.
IList <string> endPointNames = Reader.Config.EndpointNames;
Fetch Saved End point Configuration
The application can call method reader.Config.getEndpointConfigByName to get the saved configuration based on provided end point configuration name.
EndpointConfigurationInfo endpointConfigurationInfo = Reader.Config.GetEndpointConfigByName(endPointName);
Activate Saved End point Configuration
The application can call method reader.Config.activateEndpoint to activate the saved end point configuration based on provided end point configuration name.
public RFIDResults activateEndPointConfiguration(string endPointName) {
try {
IotConfigInfo iotConfigInfo = new IotConfigInfo();
iotConfigInfo.Activemgmtep = endPointName;
return Reader.Config.ActivateEndpoint(iotConfigInfo);
} catch (InvalidUsageException | OperationFailureException e) {
e.printStackTrace(); // Failure Cases Throws exception
}
return RFIDResults.RFID_API_UNKNOWN_ERROR;
}
Fetch Active End Point Configuration Name
The application can call method reader.Config.getActiveEndpoints to fetch the activated end point configuration.
IotConfigInfo iotConfigInfo = rfidModel.rfidReader.Config.ActiveEndpoints;
string activeEndpoint = iotConfigInfo.Activemgmtep;