Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CS108iOSClient.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.5;
MARKETING_VERSION = 3.6;
PRODUCT_BUNDLE_IDENTIFIER = com.csl.CS108iOSClient;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -720,7 +720,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 3.5;
MARKETING_VERSION = 3.6;
PRODUCT_BUNDLE_IDENTIFIER = com.csl.CS108iOSClient;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1310"
LastUpgradeVersion = "1400"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
294 changes: 158 additions & 136 deletions CS108iOSClient/CSLRfidDemoApp.storyboard

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CS108iOSClient/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>3060</string>
<string>3076</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSBluetoothAlwaysUsageDescription</key>
Expand Down
2 changes: 2 additions & 0 deletions CS108iOSClient/ViewControllers/CSLInventoryVC.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
@property (weak, nonatomic) IBOutlet UIView *uivSendTagData;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *actInventorySpinner;
@property (weak, nonatomic) IBOutlet UILabel *lbElapsedTime;
@property (weak, nonatomic) IBOutlet UIButton *btnTagDisplay;

- (IBAction)btnInventoryPressed:(id)sender;
- (IBAction)btnClearTable:(id)sender;
- (IBAction)btnSendTagData:(id)sender;
- (IBAction)btnSaveData:(id)sender;
- (IBAction)btnTagDispalyPressed:(id)sender;



Expand Down
43 changes: 31 additions & 12 deletions CS108iOSClient/ViewControllers/CSLInventoryVC.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ @implementation CSLInventoryVC
@synthesize lbMode;
@synthesize uivSendTagData;
@synthesize lbElapsedTime;
@synthesize btnTagDisplay;

- (void)viewDidLoad {
[super viewDidLoad];
Expand Down Expand Up @@ -326,7 +327,7 @@ - (IBAction)btnInventoryPressed:(id)sender {

}

- (IBAction)btnClearTable:(id)sender {
- (void)ClearTable {
//clear UI
lbTagRate.text=@"0";
lbTagCount.text=@"0";
Expand All @@ -336,8 +337,26 @@ - (IBAction)btnClearTable:(id)sender {
[tblTagList reloadData];
}

- (IBAction)btnClearTable:(id)sender {
[self ClearTable];
}

- (IBAction)btnTagDispalyPressed:(id)sender {
if ([[self->btnTagDisplay currentTitle] containsString:@"HEX"]) {
[self ClearTable];
[btnTagDisplay setTitle:@"Display: ASCII" forState:UIControlStateNormal];
}
else {
[self ClearTable];
[btnTagDisplay setTitle:@"Display: HEX" forState:UIControlStateNormal];
}

}

- (IBAction)btnSaveData:(id)sender {

bool IsAsciiDisplay = [[self->btnTagDisplay currentTitle] containsString:@"ASCII"];

NSString* fileContent = @"TIMESTAMP,EPC,DATA1,DATA2,RSSI\n";

for (CSLBleTag* tag in [CSLRfidAppEngine sharedAppEngine].reader.filteredBuffer) {
Expand All @@ -349,7 +368,7 @@ - (IBAction)btnSaveData:(id)sender {
NSString *stringFromDate = [dateFormatter stringFromDate:date];


fileContent=[fileContent stringByAppendingString:[NSString stringWithFormat:@"%@,%@,%@,%@,%@\n", stringFromDate, tag.EPC, tag.DATA1, tag.DATA2, [NSString stringWithFormat:@"%d",tag.rssi]]];
fileContent=[fileContent stringByAppendingString:[NSString stringWithFormat:@"%@,%@,%@,%@,%@\n", stringFromDate, (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:tag.EPC] : tag.EPC), (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:tag.DATA1] : tag.DATA1), (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:tag.DATA2] : tag.DATA2), [NSString stringWithFormat:@"%d",tag.rssi]]];
}

NSArray *objectsToShare = @[fileContent];
Expand Down Expand Up @@ -452,7 +471,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

bool IsAsciiDisplay = [[self->btnTagDisplay currentTitle] containsString:@"ASCII"];
CSLTagListCell * cell;
//for rfid data
if ([[[CSLRfidAppEngine sharedAppEngine].reader.filteredBuffer objectAtIndex:indexPath.row] isKindOfClass:[CSLBleTag class]]) {
Expand All @@ -472,22 +491,22 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
}

if (data1 != NULL && data2 != NULL ) {
cell.lbCellEPC.text = [NSString stringWithFormat:@"%d \u25CF %@", (int)(indexPath.row + 1), epc];
cell.lbCellEPC.text = [NSString stringWithFormat:@"%d \u25CF %@", (int)(indexPath.row + 1), (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:epc] : epc)];
if ([CSLRfidAppEngine sharedAppEngine].reader.readerModelNumber == CS463)
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\n%@=%@\nRSSI: %d | Port: %d", data1bank, data1, data2bank, data2, rssi, portNumber+1];
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\n%@=%@\nRSSI: %d | Port: %d", data1bank, (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:data1] : data1), data2bank, (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:data2] : data2), rssi, portNumber+1];
else
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\n%@=%@\nRSSI: %d", data1bank, data1, data2bank, data2, rssi];
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\n%@=%@\nRSSI: %d", data1bank, (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:data1] : data1), data2bank, (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:data2] : data2), rssi];
}
else if (data1 != NULL) {
cell.lbCellEPC.text = [NSString stringWithFormat:@"%d \u25CF %@", (int)(indexPath.row + 1), epc];
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\nRSSI: %d", data1bank, data1, rssi];
cell.lbCellEPC.text = [NSString stringWithFormat:@"%d \u25CF %@", (int)(indexPath.row + 1), (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:epc] : epc)];
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\nRSSI: %d", data1bank, (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:data1] : data1), rssi];
if ([CSLRfidAppEngine sharedAppEngine].reader.readerModelNumber == CS463)
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\nRSSI: %d | Port: %d", data1bank, data1, rssi, portNumber+1];
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\nRSSI: %d | Port: %d", data1bank, (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:data1] : data1), rssi, portNumber+1];
else
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\nRSSI: %d", data1bank, data1, rssi];
cell.lbCellBank.text= [NSString stringWithFormat:@"%@=%@\nRSSI: %d", data1bank, (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:data1] : data1), rssi];
}
else {
cell.lbCellEPC.text = [NSString stringWithFormat:@"%d \u25CF %@", (int)(indexPath.row + 1), epc];
cell.lbCellEPC.text = [NSString stringWithFormat:@"%d \u25CF %@", (int)(indexPath.row + 1), (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:epc] : epc)];
if ([CSLRfidAppEngine sharedAppEngine].reader.readerModelNumber == CS463)
cell.lbCellBank.text= [NSString stringWithFormat:@"RSSI: %d | Port: %d", rssi, portNumber+1];
else
Expand All @@ -505,7 +524,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell = [tableView dequeueReusableCellWithIdentifier:@"TagCell"];
}

cell.lbCellEPC.text = [NSString stringWithFormat:@"%d \u25CF %@", (int)(indexPath.row + 1), bc];
cell.lbCellEPC.text = [NSString stringWithFormat:@"%d \u25CF %@", (int)(indexPath.row + 1), (IsAsciiDisplay ? [CSLReaderBarcode convertHexStringToAscii:bc] : bc)];
cell.lbCellBank.text= [NSString stringWithFormat:@"[%@]", ((CSLReaderBarcode*)[[CSLRfidAppEngine sharedAppEngine].reader.filteredBuffer objectAtIndex:indexPath.row]).codeId];

}
Expand Down
5 changes: 5 additions & 0 deletions CS108iOSClient/model/CSLReaderBarcode.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ + (NSString*) convertDataToHexString:(NSData*) data {
}

+ (NSString*) convertHexStringToAscii:(NSString*) hexString {
//in the case where user provide hex string with odd length
if ([hexString length] % 2 != 0) {
return @"";
}

NSMutableString * newString = [[NSMutableString alloc] init];
int i = 0;
while (i < [hexString length])
Expand Down
4 changes: 3 additions & 1 deletion Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.