-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when decode packets in Buffer #8
Comments
At the moment, we have control on the demo application level so that the Buffer will be cleared every time when switching between RFID and barcode scanning as the buffer was originally designed to handle either RFID or barcode at a time. We will put in filter function on the library level for a better design that will avoid this issue. |
Thank you so much. |
Hi, when can I take an updated release? |
We are looking into this and will get back to you shortly. At the same time, please kindly submit a request through https://www.convergence.com.hk/support/ for getting this prioritized. |
Ok, I will do. |
Binary search insertions of the filteredBuffer can now hold both the CSLReaderBarcode and CSLBleTag objects, where the objects are being compared based on the EPC or barcode value only. |
Could you check
- (void)decodePacketsInBufferAsync;
in the CSLBleReader.mNSUInteger findIndex = [filteredBuffer indexOfObject:barcode inSortedRange:searchRange options:NSBinarySearchingInsertionIndex | NSBinarySearchingFirstEqual usingComparator:^(id obj1, id obj2) { NSString* str1=((CSLReaderBarcode*)obj1).barcodeValue; NSString* str2=((CSLReaderBarcode*)obj2).barcodeValue; return [str1 compare:str2 options:NSCaseInsensitiveSearch]; }];
Here sometimes obj1 is CSLBleTag object and obj2 is CSLReaderBarcode.
So
NSString* str1=((CSLReaderBarcode*)obj1).barcodeValue;
crashes.Suggetion:
You can add some filter functions above the codes so that we can handle only CSLReaderBarcode objects, what do you think?
Ditto
NSUInteger findIndex = [filteredBuffer indexOfObject:tag inSortedRange:searchRange options:NSBinarySearchingInsertionIndex | NSBinarySearchingFirstEqual usingComparator:^(id obj1, id obj2) { NSString* str1=((CSLBleTag*)obj1).EPC; NSString* str2=((CSLBleTag*)obj2).EPC; return [str1 compare:str2 options:NSCaseInsensitiveSearch]; }];
Here sometimes obj1 is CSLReaderBarcode and obj2 is CSLBleTag.
So
NSString* str1=((CSLBleTag*)obj1).EPC;
crashes.The text was updated successfully, but these errors were encountered: