Does anyone know of or have a manual on how to script in xcode with the linea-pro.
I have hunted the web and asked Infinite Peripherals for help but no reply.
<Import the .a and .h file
Add ExternalAccessory.framework
open your info.plist file as source code and add the following lines:
<key>UIBackgroundModes</key>
<array>
<string>external-accessory</string>
</array>
<key>UISupportedExternalAccessoryProtocols</key>
<array>
<string>com.datecs.linea.pro.msr</string>
<string>com.datecs.linea.pro.bar</string>
<string>com.datecs.printer.escpos</string>
<string>com.datecs.iserial.communication</string>
<string>com.datecs.pinpad</string>
</array>
Add <DTDeviceDelegate>
to your interface like this:
@interface ViewController : UIViewController <DTDeviceDelegate>
In your .h file of your ViewController add the DTDevices object
@interface ViewController : UIViewController <DTDeviceDelegate>
{
DTDevices *scanner;
}
In the ViewDidLoad function, add the connection code:
scanner=[DTDevices sharedDevice];
[scanner addDelegate:self];
[scanner connect];
Get connection status by adding this method to your code:
-(void)connectionState:(int)state {
switch (state) {
case CONN_DISCONNECTED:
//Disconnected
break;
case CONN_CONNECTING:
//Connecting
break;
case CONN_CONNECTED:
//Connected
break;
}
}
Hope this helps.
I'm assuming that you are wanting to develop an application with their iPhone/iPod Touch sled. Your best bet will be to look at the sample Xcode project they include with their SDK. This will demonstrate how to connect with the sled, as well as set different options for interacting with the hardware, such as the barcode types it should look for (in cases where you're using a 2D scanner), any hardware sounds it should make, etc.
Their underlying assumption is that you're an experienced iOS developer and you're ready to start integrating with their SDK. It sounds like you're new to iOS development and I would encourage you to get experienced with that before doing something a little more advanced like interacting with hardware peripherals.
At a high level you'll need to:
ExternalAccessory.framework
. To provides access to Linea device series.
In order to use Linea in your program, several steps have to be performed. These steps are from 2011, and may have changed in 2017, but are shown here for historical purposes:
- Include LineaSDK.h and libdtdev.a in your project.
- Go to Frameworks and add ExternalAccessory framework
- Edit your program plist file, add new element and select
"Supported external accessory protocols" from the list, then add two items to it -
‘com.datecs.linea.pro.msr’ and ‘com.datecs.linea.pro.bar’
- Write code in MainViewController.m file to connect and retrieve barcode data.
1) Include “LineaSDK.h” and “libdtdev.a” in your project under Classes folder.
2017 update: Download latest DTDEVICES SDK from developer.ipcmobile.com . As of January 2017, latest version is v2.01, supporting devices up to the Linea Pro 7.
2) “Add existing frameworks” in your project.
3) Edit your project .plist file
<key>Supported external accessory protocols</key>
<value>
<array>
<string>com.datecs.linea.pro.msr</string>
<string>com.datecs.linea.pro.bar</string>
</array>
</value>
4) Write code in MainViewController.m file
// Important to init linea class and connect it
- (void)viewDidLoad
{
// init linea class and connect it
linea =[Linea sharedDevice];
[linea addDelegate:self];
[linea connect];
[super viewDidLoad];
}
// It calls after successfuly reads barode data
-(void)barcodeData:(NSString *)barcode type:(int)type {
// You can use this data as you wish
// Here I write barcode data into the console
NSLog(@"Barcode Data: %@”, barcode);
}
Note: Import ‘LineaSDK.h’ into your MainViewController.h and declare
Linea* linea;
variable.
It works very well.