TMS Update Check Time Window
The POS can specify the time window during which the terminal management system update check should take place. The default time window is 4:30 AM - 7:30 AM local time.
info_outline
note
The update check will not disrupt an in-progress transaction or other card reader operation. If an update is needed, Commerce SDK will wait until the current operation finishes to perform the update.
Code Samples
CWS
Request
{
"method" : "setTmsUpdateCheckTimeWindowOnCardReader",
"requestId" : "-597482921",
"targetType" : "cardReader",
"version" : "1.0",
"parameters" : {
"duration" : "2",
"startTime" : "06:00"
}
}
Response
{
"requestId" : "-597482919",
"statusDetails" : "REQUEST_ACCEPTED",
"data" : {
"cardReaderCommand" : {
"id" : "-597482921",
"completed" : true,
"eventQueue" : [ {
"timeStamp" : "1678890765377",
"statusDetails" : "SET_TMS_UPDATE_CHECK_TIME_WINDOW_COMPLETED"
}, {
"timeStamp" : "1678890765378",
"statusDetails" : "SET_TMS_UPDATE_CHECK_TIME_WINDOW_SUCCEEDED"
} ]
}
}
}
Java
// The following code is copied from MainActivity.java in the sample application code.
// The call requires
// ECLTime startTime
// int duration (in hours)
// ECLCardReaderSetTmsUpdateCheckTimeWindowListener
cardReaderInterface.setTmsUpdateCheckTimeWindow(startTime, duration, new ECLCardReaderSetTmsUpdateCheckTimeWindowListener()
{
@Override
public void deviceOperationCompleted(ECLCardReaderInterface eclCardReaderInterface, ECLTransactionProgress s)
{
displayMessage("setTmsUpdateCheckTimeWindow - success");
}
@Override
public void deviceOperationError(ECLCardReaderInterface eclCardReaderInterface, ECCError eccError)
{
displayMessage(String.format("setTmsUpdateCheckTimeWindowError: %s", eccError.getDebugDescription()));
}
@Override
public void deviceOperationProgress(ECLCardReaderInterface eclCardReaderInterface, ECLTransactionProgress progress)
{
displayMessage(String.format("setTmsUpdateCheckTimeWindow: %s", progress.name()));
}
});
Objective-C
// The full implementation of the following code can be found in TmsUpdateCheckViewController.h/TmsUpdateCheckViewController.m in the iOS sample application.
@interface TmsUpdateCheckViewController : BaseViewController<ECLGeneralOperationDelegate>
// ...
@end
@implementation TmsUpdateCheckViewController
// calling the API
- (void)setTimeWindowButtonClicked {
id<ECLCardReaderProtocol> cardReader = _mainViewController._cardReader;
ECLTime *startTime = [[ECLTime alloc] initWithHour:4 minute:30];
int durationInHours = 3;
[cardReader setTmsUpdateCheckTimeWindow:self startTime:startTime durationInHours:durationInHours];
}
// implement delegate methods
- (void)progress:(ECLTransactionProgress)progress {
[self addStatusString:[NSString stringWithFormat:@"%@\n",[ECLDebugDescriptions descriptionOfTransactionProgress:progress]]];
}
- (void)completed:(BOOL)success error:(NSError *)error {
if (success) {
[self addStatusString:@"Operation competed successfully.\n"];
} else {
[self addStatusString:[NSString stringWithFormat:@"Operation failed: %@\n",[error debugDescription]]];
}
}
@end
C#
// Asynchronous version
StartSetTmsUpdateCheckTimeWindowOnCardReader(String deviceSerialNumber, String startTime, int duration, NotifyCWSEvent ne, OnDemandCardReaderOperationComplete<SetTmsUpdateCheckTimeWindowOnCardReaderResults> completeDelegate)
// Synchronous version
SetTmsUpdateCheckTimeWindowOnCardReader(String startTime, int duration, NotifyCWSEvent ne)
// Example handling response
public void MySetTmsUpdateCheckTimeWindowOnCardReaderComplete(SetTmsUpdateCheckTimeWindowOnCardReaderResults rsr)
{
Log("----------- MySetTmsUpdateCheckTimeWindowOnCardReader Complete ------------");