Skip to content
Open
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
Binary file modified StarIO.zip
Binary file not shown.
Binary file modified android/libs/StarIOPort3.1.jar
100755 → 100644
Binary file not shown.
Binary file modified android/libs/starioextension.jar
100755 → 100644
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,17 @@ public void connect(final String portName, final String emulation, final Boolean

String portSettings = getPortSettingsOption(emulation);
if (starIoExtManager != null && starIoExtManager.getPort() != null) {
starIoExtManager.disconnect(null);
starIoExtManager.disconnect(new IConnectionCallback() {
@Override
public void onConnected(ConnectResult connectResult) {
// Do nothing
}

@Override
public void onDisconnected() {
//Do nothing
}
});
}
starIoExtManager = new StarIoExtManager(hasBarcodeReader ? StarIoExtManager.Type.WithBarcodeReader : StarIoExtManager.Type.Standard, portName, portSettings, 10000, context);
starIoExtManager.setListener(starIoExtManagerListener);
Expand Down
1 change: 1 addition & 0 deletions ios/Frameworks/StarIO.framework/Headers
1 change: 1 addition & 0 deletions ios/Frameworks/StarIO.framework/Resources
Binary file removed ios/Frameworks/StarIO.framework/StarIO
Binary file not shown.
1 change: 1 addition & 0 deletions ios/Frameworks/StarIO.framework/StarIO
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,18 @@
@property(retain) NSThread *thread71;
@property(retain) NSNumber *result71;

@property(assign, readonly) float secShortInterval;
@property(assign, readonly) float secInterval;
@property(assign, readonly) float secInterval1;
@property(assign, readonly) float secInterval2;

- (id)initWithPortName:(NSString *)portName portSettings:(NSString *)portSettings timeout:(u_int32_t)timeout emulation:(SMEmulation)emulation;
@property(retain, nonatomic) NSString *name;
@property(retain, nonatomic) NSString *serialNumber;

@property(nonatomic) NSUInteger connectionID;

- (id)initWithPortName:(NSString *)portName
portSettings:(NSString *)portSettings
timeout:(u_int32_t)timeout
emulation:(SMEmulation)emulation;
- (BOOL)open;
- (int)write:(NSData *)data;
- (NSData *)read:(NSUInteger)bytesToRead;
Expand Down
18 changes: 18 additions & 0 deletions ios/Frameworks/StarIO.framework/Versions/A/Headers/SMFileLogger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// SMFileLogger.h
// StarIOPort
//
// Created by u3415 on 2018/09/14.
//

#import "SMLogger.h"

@interface SMFileLogger : SMLogger

@property(class, nonatomic, readonly, nonnull) SMFileLogger *sharedInstance NS_SWIFT_NAME(shared);

@property(nonatomic) NSUInteger maxLogSize;

@property(nonatomic, readonly, nonnull) NSString *logDirectoryPath;

@end
26 changes: 26 additions & 0 deletions ios/Frameworks/StarIO.framework/Versions/A/Headers/SMLogger.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// SMLogger.h
// StarIOPort
//
// Created by u3415 on 2018/09/14.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, SMLogLevel) {
SMLogLevelDefault
};

@interface SMLogger : NSObject

@property (nonatomic) SMLogLevel logLevel;

@property(nonatomic, readonly) BOOL isLogging;

- (void)logString:(nonnull NSString *)string NS_SWIFT_NAME(log(_:));

- (void)start;

- (void)stop;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
#import "WBluetoothPort.h"
#import "ExternalAccessoryPort.h"
#import "Lock.h"
#import "SMFileLogger.h"
#import "SMStarIOResultCode.h"

@interface PortException : NSException
{
}
#import "exceptions/PortException.h"

@end

@interface PortInfo : NSObject

- (id)initWithPortName:(NSString *)portName_ macAddress:(NSString *)macAddress_ modelName:(NSString *)modelName_;
- (id)initWithPortName:(NSString *)portName_
macAddress:(NSString *)macAddress_
modelName:(NSString *)modelName_;

@property(retain, readonly) NSString *portName;
@property(retain, readonly) NSString *macAddress;
Expand All @@ -49,18 +50,22 @@
BOOL checkedBlockSupport;
}

@property(assign, nonatomic) NSString *name;
@property(assign, nonatomic) NSString *identifier;

@property(nonatomic) NSUInteger connectionID;

@property(assign, readwrite, nonatomic) u_int32_t endCheckedBlockTimeoutMillis;

+ (NSString *)StarIOVersion;

- (id)init:(NSString *)portName :(NSString *)portSettings :(u_int32_t)ioTimeoutMillis;

/*!
* Search printer on LAN or paired bluetooth device.
*
* @return List of printers that were found.
*/
+ (NSArray *)searchPrinter;
+ (NSArray *)searchPrinter
__attribute__((deprecated("Please replace this method with 'searchPrinter(target:) throws' for Swift or 'searchPrinter:(NSString *)target :(NSError **)error' for Objective-C, and pass 'ALL:' as the target argument.")));

/*!
* Search printer on LAN or paired bluetooth device.
Expand All @@ -69,7 +74,8 @@
*
* @return List of printers that were found.
*/
+ (NSArray *)searchPrinter:(NSString *)target;
+ (NSArray *)searchPrinter:(NSString *)target
__attribute__((deprecated("Please replace this method with 'searchPrinter(target:) throws' for Swift or 'searchPrinter:(NSString *)target :(NSError **)error' for Objective-C.")));

/*!
* This function opens a connection to the port specified.
Expand All @@ -85,7 +91,8 @@
*
* @return SMPort class for StarIO port.
*/
+ (SMPort *)getPort:(NSString *)portName :(NSString *)portSettings :(u_int32_t)ioTimeoutMillis;
+ (SMPort *)getPort:(NSString *)portName :(NSString *)portSettings :(u_int32_t)ioTimeoutMillis
__attribute__((deprecated("Please replace this method with 'getPort(portName:portSettings:ioTimeoutMillis:) throws' for Swift or 'getPort:(NSString *)portName :(NSString *)portSettings :(u_int32_t)ioTimeoutMillis :(NSError **)error;' for Objective-C.")));

/*!
* This function closes a connection to the port specified.
Expand All @@ -105,7 +112,10 @@
*
* @note Throws PortException on failure.
*/
- (u_int32_t)writePort:(u_int8_t const *)writeBuffer :(u_int32_t)offSet :(u_int32_t)size;
- (u_int32_t)writePort:(u_int8_t const *)writeBuffer :(u_int32_t)offSet :(u_int32_t)size
NS_SWIFT_UNAVAILABLE("This method throws an Objective-C exception. "
"Please replace this method with 'write(writeBuffer:offset:size:numberOfBytesWritten:) throws'.")
__attribute__((deprecated("Please replace this method with 'write(writeBuffer:offset:size:numberOfBytesWritten:) throws' for Swift or 'writePort:(u_int8_t const *)writeBuffer :(u_int32_t)offSet :(u_int32_t)size :(NSError **)error;' for Objective-C.")));

/*!
* This function reads data from the device.
Expand All @@ -118,7 +128,12 @@
*
* @note Throws PortException on failure.
*/
- (u_int32_t)readPort:(u_int8_t *)readBuffer :(u_int32_t)offSet :(u_int32_t)size;
- (u_int32_t)readPort:(u_int8_t *)readBuffer
:(u_int32_t)offSet
:(u_int32_t)size
NS_SWIFT_UNAVAILABLE("This method throws an Objective-C exception. "
"Please replace this method with 'read(readBuffer:offset:size:numberOfBytesRead:) throws'.")
__attribute__((deprecated("Please replace this method with 'read(readBuffer:offset:size:numberOfBytesRead:) throws' for Swift or 'readPort:(u_int8_t *)readBuffer :(u_int32_t)offSet :(u_int32_t)size :(NSError **)error' for Objective-C.")));

/*!
* This function retreives the device's detailed status.
Expand All @@ -129,21 +144,31 @@
*
* @note Throws PortException on failure.
*/
- (void)getParsedStatus:(void *)starPrinterStatus :(u_int32_t)level;
- (void)getParsedStatus:(void *)starPrinterStatus
:(u_int32_t)level
NS_SWIFT_UNAVAILABLE("This method throws an Objective-C exception."
"Please replace this method with 'getParsedStatus(starPrinterStatus:level:) throws'.")
__attribute__((deprecated("Please replace this method with 'getParsedStatus(starPrinterStatus:level:) throws' for Swift or 'getParsedStatus:(void *)starPrinterStatus :(u_int32_t)level :(NSError **)error' for Objective-C.")));

/*!
* This function retrieves the device's firmware information.
*
* @return NSDictionary class that contains firmware information.
*/
- (NSDictionary *)getFirmwareInformation;
- (NSDictionary *)getFirmwareInformation
NS_SWIFT_UNAVAILABLE("This method throws an Objective-C exception."
"Please replace this method with 'getFirmwareInformation() throws'.")
__attribute__((deprecated("Please replace this method with 'getFirmwareInformation() throws' for Swift or 'getFirmwareInformation:(NSError **)error' for Objective-C.")));

/*!
* This function retrieves the device's Dip Switch information.
*
* @return NSDictionary class that contains Dip Switch information.
*/
- (NSDictionary *)getDipSwitchInformation;
- (NSDictionary *)getDipSwitchInformation
NS_SWIFT_UNAVAILABLE("This method throws an Objective-C exception."
"Please replace this method with 'getDipSwitchInformation(error:)'.")
__attribute__((deprecated("Please replace this method with 'getDipSwitchInformation(error:)'.")));

/*!
* This function retreives the device's online status.
Expand All @@ -153,7 +178,10 @@
*
* @note Throws PortException on failure.
*/
- (bool)getOnlineStatus;
- (bool)getOnlineStatus
NS_SWIFT_UNAVAILABLE("This method throws an Objective-C exception."
"Please replace this method with 'getOnlineStatusWithError(error:)'.")
__attribute__((deprecated("Please replace this method with 'getOnlineStatusWithError(error:)'.")));

/*!
* This function initiates a checked block printing operation and returns the devices detailed status.
Expand All @@ -164,7 +192,10 @@
*
* @note Throws PortException on failure.
*/
- (void)beginCheckedBlock:(void *)starPrinterStatus :(u_int32_t)level;
- (void)beginCheckedBlock:(void *)starPrinterStatus :(u_int32_t)level
NS_SWIFT_UNAVAILABLE("This method throws an Objective-C exception."
"Please replace this method with 'beginCheckedBlock(starPrinterStatus:level:) throws'.")
__attribute__((deprecated("Please replace this method with 'beginCheckedBlock(starPrinterStatus:level:) throws' for Swift or 'beginCheckedBlock:(void *)starPrinterStatus :(u_int32_t)level :(NSError **)error' for Objective-C.")));

/*!
* This function ends a checked block printing operation and returns the devices detailed status.
Expand All @@ -177,7 +208,10 @@
*
* @note Throws PortException on failure
*/
- (void)endCheckedBlock:(void *)starPrinterStatus :(u_int32_t)level;
- (void)endCheckedBlock:(void *)starPrinterStatus :(u_int32_t)level
NS_SWIFT_UNAVAILABLE("This method throws an Objective-C exception."
"Please replace this method with 'endCheckedBlock(starPrinterStatus:level:) throws'.")
__attribute__((deprecated("Please replace this method with 'endCheckedBlock(starPrinterStatus:level:) throws' for Swift or 'endCheckedBlock:(void *)starPrinterStatus :(u_int32_t)level :(NSError **)error' for Objective-C.")));

/*!
* Disconnect Bluetooth port for Desktop Printer and DK-AirCash.
Expand All @@ -186,36 +220,67 @@
*/
- (BOOL)disconnect;


+ (NSMutableData *)compressRasterData:(int32_t)width :(int32_t)height :(u_int8_t *)imageData :(NSString *)portSettings;
+ (NSMutableData *)generateBitImageCommand:(int32_t)width :(int32_t)height :(u_int8_t *)imageData :(NSString *)portSettings __attribute__((deprecated));

- (NSString *)portName;
- (NSString *)portSettings;
- (u_int32_t)timeoutMillis;
- (BOOL)connected;

+ (void)setMACAddressSourceBlock:(NSString *(^)(EAAccessory *accessory))macAddressSourceBlock;

//
// NSError was added to the argument of API.
//

- (u_int32_t)writePort:(u_int8_t const *)writeBuffer :(u_int32_t)offSet :(u_int32_t)size :(NSError **)error;
+ (NSArray *)searchPrinter:(NSString *)target
:(NSError **)error NS_SWIFT_NOTHROW;

+ (SMPort *)getPort:(NSString *)portName
:(NSString *)portSettings
:(u_int32_t)ioTimeoutMillis
:(NSError **)error NS_SWIFT_NOTHROW;

- (u_int32_t)writePort:(u_int8_t const *)writeBuffer
:(u_int32_t)offSet
:(u_int32_t)size
:(NSError **)error;

- (u_int32_t)readPort:(u_int8_t *)readBuffer :(u_int32_t)offSet :(u_int32_t)size :(NSError **)error;
- (u_int32_t)readPort:(u_int8_t *)readBuffer
:(u_int32_t)offSet
:(u_int32_t)size
:(NSError **)error;

- (SM_BOOLEAN)getParsedStatus:(void *)starPrinterStatus :(u_int32_t)level :(NSError **)error;
- (SM_BOOLEAN)getParsedStatus:(void *)starPrinterStatus
:(u_int32_t)level
:(NSError **)error;

- (NSDictionary *)getFirmwareInformation:(NSError **)error;
- (NSDictionary *)getFirmwareInformation:(NSError **)error NS_SWIFT_NOTHROW;

- (NSDictionary *)getDipSwitchInformation:(NSError **)error;
- (NSDictionary *)getDipSwitchInformation:(NSError **)error NS_SWIFT_NOTHROW;

- (bool)getOnlineStatus:(NSError **)error
__attribute__((unavailable("Not available. Please replace this method with 'getOnlineStatusWithError(error:)'.")));

- (bool)getOnlineStatus:(NSError **)error __attribute__((unavailable("Not available. Please change to getOnlineStatusWithError:.")));
- (SM_BOOLEAN)getOnlineStatusWithError:(NSError **)error;

- (SM_BOOLEAN)beginCheckedBlock:(void *)starPrinterStatus :(u_int32_t)level :(NSError **)error;

- (SM_BOOLEAN)endCheckedBlock:(void *)starPrinterStatus :(u_int32_t)level :(NSError **)error;

- (BOOL)disconnect:(NSError **)error NS_SWIFT_NOTHROW;



+ (NSMutableData *)compressRasterData:(int32_t)width
:(int32_t)height
:(u_int8_t *)imageData
:(NSString *)portSettings;

+ (NSMutableData *)generateBitImageCommand:(int32_t)width
:(int32_t)height
:(u_int8_t *)imageData
:(NSString *)portSettings __attribute__((deprecated));

- (NSString *)portName;

- (NSString *)portSettings;

- (u_int32_t)timeoutMillis;

- (BOOL)connected;

+ (void)setMACAddressSourceBlock:(NSString *(^)(EAAccessory *accessory))macAddressSourceBlock;

@end
Loading