@m430/capacitor-label-printer 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API.md +218 -0
- package/LICENSE +21 -0
- package/M430CapacitorLabelPrinter.podspec +21 -0
- package/README.md +190 -0
- package/android/build.gradle +46 -0
- package/android/libs/.gitkeep +1 -0
- package/android/libs/fat-generic-tspl-bluetooth-classic-0.1.16-GA.jar +0 -0
- package/android/src/main/AndroidManifest.xml +12 -0
- package/android/src/main/java/com/m430/capacitor/labelprinter/.gitkeep +1 -0
- package/android/src/main/java/com/m430/capacitor/labelprinter/AndroidPrinterManager.java +132 -0
- package/android/src/main/java/com/m430/capacitor/labelprinter/AndroidStatusMapper.java +54 -0
- package/android/src/main/java/com/m430/capacitor/labelprinter/LabelPrinterPlugin.java +273 -0
- package/android/src/main/java/com/m430/capacitor/labelprinter/VendorAndroidDeviceCatalog.java +81 -0
- package/android/src/main/java/com/m430/capacitor/labelprinter/VendorAndroidPrinterSession.java +189 -0
- package/capacitor-label-printer.podspec +21 -0
- package/dist/docs.json +443 -0
- package/dist/esm/cpcl/builder.d.ts +10 -0
- package/dist/esm/cpcl/builder.js +35 -0
- package/dist/esm/definitions.d.ts +107 -0
- package/dist/esm/definitions.js +1 -0
- package/dist/esm/errors.d.ts +1 -0
- package/dist/esm/errors.js +1 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.js +11 -0
- package/dist/esm/tspl/builder.d.ts +13 -0
- package/dist/esm/tspl/builder.js +45 -0
- package/dist/esm/tspl/helpers.d.ts +2 -0
- package/dist/esm/tspl/helpers.js +6 -0
- package/dist/esm/types.d.ts +12 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/web.d.ts +21 -0
- package/dist/esm/web.js +34 -0
- package/dist/plugin.cjs.js +143 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +136 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Plugin/.gitkeep +1 -0
- package/ios/Plugin/IOSPrinterManager.swift +230 -0
- package/ios/Plugin/IOSStatusMapper.swift +57 -0
- package/ios/Plugin/LabelPrinterPlugin.swift +141 -0
- package/ios/VendorFrameworks/.gitkeep +1 -0
- package/ios/VendorFrameworks/adapter.framework/Headers/BasedOtherConnectedDevice.h +17 -0
- package/ios/VendorFrameworks/adapter.framework/Headers/ConnectedDevice.h +213 -0
- package/ios/VendorFrameworks/adapter.framework/Headers/IPRTBlueToothBaseDef.h +22 -0
- package/ios/VendorFrameworks/adapter.framework/Headers/KeepStateConnectedDevice.h +18 -0
- package/ios/VendorFrameworks/adapter.framework/Headers/QueueConfig.h +18 -0
- package/ios/VendorFrameworks/adapter.framework/Headers/ReadOptions.h +22 -0
- package/ios/VendorFrameworks/adapter.framework/Headers/WroteReporter.h +23 -0
- package/ios/VendorFrameworks/adapter.framework/Headers/adapter.h +18 -0
- package/ios/VendorFrameworks/adapter.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/adapter.framework/Modules/module.modulemap +6 -0
- package/ios/VendorFrameworks/adapter.framework/adapter +0 -0
- package/ios/VendorFrameworks/appleble.framework/Frameworks/adapter.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/appleble.framework/Frameworks/adapter.framework/_CodeSignature/CodeResources +101 -0
- package/ios/VendorFrameworks/appleble.framework/Frameworks/adapter.framework/adapter +0 -0
- package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/Frameworks/adapter.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/Frameworks/adapter.framework/adapter +0 -0
- package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/_CodeSignature/CodeResources +132 -0
- package/ios/VendorFrameworks/appleble.framework/Frameworks/ibridge.framework/ibridge +0 -0
- package/ios/VendorFrameworks/appleble.framework/Headers/AppleBle.h +25 -0
- package/ios/VendorFrameworks/appleble.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/appleble.framework/Modules/module.modulemap +6 -0
- package/ios/VendorFrameworks/appleble.framework/_CodeSignature/CodeResources +252 -0
- package/ios/VendorFrameworks/appleble.framework/appleble +0 -0
- package/ios/VendorFrameworks/father.framework/Frameworks/adapter.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/father.framework/Frameworks/adapter.framework/adapter +0 -0
- package/ios/VendorFrameworks/father.framework/Headers/Appendat.h +28 -0
- package/ios/VendorFrameworks/father.framework/Headers/Arg.h +22 -0
- package/ios/VendorFrameworks/father.framework/Headers/BasicBatteryVolumeArg.h +16 -0
- package/ios/VendorFrameworks/father.framework/Headers/BinaryCommand.h +17 -0
- package/ios/VendorFrameworks/father.framework/Headers/CPCLCommand.h +10 -0
- package/ios/VendorFrameworks/father.framework/Headers/CallbackData.h +26 -0
- package/ios/VendorFrameworks/father.framework/Headers/Checker.h +16 -0
- package/ios/VendorFrameworks/father.framework/Headers/Command.h +25 -0
- package/ios/VendorFrameworks/father.framework/Headers/CommandClause.h +33 -0
- package/ios/VendorFrameworks/father.framework/Headers/Commander.h +31 -0
- package/ios/VendorFrameworks/father.framework/Headers/DataWriteOperation.h +42 -0
- package/ios/VendorFrameworks/father.framework/Headers/DefaultCommand.h +16 -0
- package/ios/VendorFrameworks/father.framework/Headers/EasyArg.h +16 -0
- package/ios/VendorFrameworks/father.framework/Headers/FastBinary.h +20 -0
- package/ios/VendorFrameworks/father.framework/Headers/HexOutput.h +19 -0
- package/ios/VendorFrameworks/father.framework/Headers/IDataWriteCallback.h +25 -0
- package/ios/VendorFrameworks/father.framework/Headers/Lifecycle.h +21 -0
- package/ios/VendorFrameworks/father.framework/Headers/NewLineArg.h +15 -0
- package/ios/VendorFrameworks/father.framework/Headers/OnlyBinaryHeaderArg.h +15 -0
- package/ios/VendorFrameworks/father.framework/Headers/OnlyTextHeaderArg.h +16 -0
- package/ios/VendorFrameworks/father.framework/Headers/PImageTool.h +22 -0
- package/ios/VendorFrameworks/father.framework/Headers/PReplaceKit.h +16 -0
- package/ios/VendorFrameworks/father.framework/Headers/PSDK.h +60 -0
- package/ios/VendorFrameworks/father.framework/Headers/PVariableKit.h +18 -0
- package/ios/VendorFrameworks/father.framework/Headers/PsdkConst.h +33 -0
- package/ios/VendorFrameworks/father.framework/Headers/Raw.h +22 -0
- package/ios/VendorFrameworks/father.framework/Headers/SimpleCheck.h +16 -0
- package/ios/VendorFrameworks/father.framework/Headers/SingleCommand.h +32 -0
- package/ios/VendorFrameworks/father.framework/Headers/TSPLCommand.h +10 -0
- package/ios/VendorFrameworks/father.framework/Headers/WriteControl.h +12 -0
- package/ios/VendorFrameworks/father.framework/Headers/WriteOptions.h +28 -0
- package/ios/VendorFrameworks/father.framework/Headers/father.h +21 -0
- package/ios/VendorFrameworks/father.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/father.framework/Modules/module.modulemap +6 -0
- package/ios/VendorFrameworks/father.framework/father +0 -0
- package/ios/VendorFrameworks/tspl.framework/Frameworks/father.framework/Frameworks/adapter.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/tspl.framework/Frameworks/father.framework/Frameworks/adapter.framework/adapter +0 -0
- package/ios/VendorFrameworks/tspl.framework/Frameworks/father.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/tspl.framework/Frameworks/father.framework/father +0 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/BasicTSPL.h +146 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/BasicTSPLArg.h +17 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/GenericTSPL.h +16 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TBar.h +30 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TBarCode.h +54 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TBatteryVolume.h +19 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TBox.h +32 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TCircle.h +26 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TCleanBmpFlash.h +20 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TClear.h +20 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TCut.h +21 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TDensity.h +21 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TDirection.h +51 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TDmatrix.h +29 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TDownloadBmpFlash.h +16 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TGap.h +21 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TImage.h +36 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TLine.h +34 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TMddle.h +16 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TPage.h +22 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TPrint.h +21 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TQRCode.h +35 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TReadState.h +16 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TReverse.h +27 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSN.h +19 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPLCodeType.h +53 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPLCorrectLevel.h +21 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPLFont.h +83 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPLImageMode.h +30 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPLLineMode.h +37 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPLLineType.h +21 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPLOutDirection.h +27 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPLRotation.h +36 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPLShowType.h +36 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSPL_.h +18 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TSpeed.h +20 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TText.h +38 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TTextBox.h +44 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/TVersion.h +19 -0
- package/ios/VendorFrameworks/tspl.framework/Headers/tspl.h +45 -0
- package/ios/VendorFrameworks/tspl.framework/Info.plist +0 -0
- package/ios/VendorFrameworks/tspl.framework/Modules/module.modulemap +6 -0
- package/ios/VendorFrameworks/tspl.framework/tspl +0 -0
- package/package.json +95 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DataWriteOperation.h
|
|
3
|
+
// father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/11/8.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import "WriteControl.h"
|
|
10
|
+
#import <adapter/ConnectedDevice.h>
|
|
11
|
+
#import "WriteOptions.h"
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
typedef NS_ENUM (NSUInteger , ESCPrinter){
|
|
15
|
+
ESCPrinter_GENERIC,
|
|
16
|
+
ESCPrinter_BY426BT,
|
|
17
|
+
ESCPrinter_QR285A,
|
|
18
|
+
ESCPrinter_L12
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
typedef NS_ENUM (NSUInteger , CPCLPrinter){
|
|
22
|
+
CPCLPrinter_GENERIC,
|
|
23
|
+
CPCLPrinter_QR365_COMPRESS
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
typedef NS_ENUM (NSUInteger , TSPLPrinter){
|
|
27
|
+
TSPLPrinter_GENERIC
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
typedef enum {
|
|
31
|
+
Raw_TEXT,
|
|
32
|
+
Raw_BINARY
|
|
33
|
+
} RawMode;
|
|
34
|
+
|
|
35
|
+
@interface DataWriteOperation : NSObject
|
|
36
|
+
|
|
37
|
+
-(instancetype)initWithOptions:(WriteOptions *)options binary:(NSData *)binary connectedDevice:(ConnectedDevice *)connectedDevice;
|
|
38
|
+
-(WroteReporter *)write;
|
|
39
|
+
|
|
40
|
+
@end
|
|
41
|
+
|
|
42
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NewDefaultCommand.h
|
|
3
|
+
// father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/12/7.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <father/Command.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface DefaultCommand : Command
|
|
13
|
+
-(instancetype)initWithClauses:(NSArray <CommandClause *> *)clauses andVariable:(NSDictionary *)variable;
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FastBinary.h
|
|
3
|
+
// Father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/10/13.
|
|
6
|
+
//
|
|
7
|
+
#import "PsdkConst.h"
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
10
|
+
|
|
11
|
+
@interface FastBinary : NSObject
|
|
12
|
+
+(instancetype)make;
|
|
13
|
+
@property(nonatomic, readonly) FastBinary *(^appendData)(NSData *data);
|
|
14
|
+
@property(nonatomic, readonly) FastBinary *(^appendString)(NSString *string);
|
|
15
|
+
@property(nonatomic, readonly) FastBinary *(^appendNumber)(int num);
|
|
16
|
+
@property(nonatomic, readonly) FastBinary *(^appendArgWithEncoding)(NSString *arg,NSStringEncoding encoding);
|
|
17
|
+
-(NSData *)output;
|
|
18
|
+
@end
|
|
19
|
+
|
|
20
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// HexOutput.h
|
|
3
|
+
// Father
|
|
4
|
+
//
|
|
5
|
+
// Created by aiyin on 2022/4/11.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface HexOutput : NSObject
|
|
13
|
+
- (NSString *)format:(NSData *)bytes;
|
|
14
|
+
@property(nonatomic , readonly)HexOutput *(^enableFormat)(BOOL isEnableFormat);
|
|
15
|
+
@property(nonatomic , readonly)HexOutput *(^enableSpacing)(BOOL isEnableSpacing);
|
|
16
|
+
@property(nonatomic , readonly)HexOutput *(^maxLengthOfLine)(int lengthOfLine);
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// IDataWriteCallback.h
|
|
3
|
+
// Father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/10/25.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import<father/WriteControl.h>
|
|
10
|
+
#import <father/CallbackData.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
typedef void (^successHandler)(DataWrite *datawrite);
|
|
15
|
+
typedef void (^failedHandler)(DataWrite *datawrite, NSException *error);
|
|
16
|
+
|
|
17
|
+
@interface IDataWriteCallback : NSObject
|
|
18
|
+
|
|
19
|
+
@property(nonatomic , readonly)WriteControl (^success)(CallbackData * data);
|
|
20
|
+
@property(nonatomic , readonly)void (^failed)(CallbackData *data,NSException *exception);
|
|
21
|
+
-(void)failed:(failedHandler)failed;
|
|
22
|
+
|
|
23
|
+
@end
|
|
24
|
+
|
|
25
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Lifecycle.h
|
|
3
|
+
// father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/11/8.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <adapter/ConnectedDevice.h>
|
|
10
|
+
#import <adapter/QueueConfig.h>
|
|
11
|
+
#import <father/PsdkConst.h>
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
@interface Lifecycle : NSObject
|
|
15
|
+
@property(nonatomic , readonly)Lifecycle *(^connectedDevice)(ConnectedDevice *device);
|
|
16
|
+
@property(nonatomic , readonly)Lifecycle *(^enableAutoNewLine)(BOOL enable);
|
|
17
|
+
-(ConnectedDevice *)getConnectedDevice;
|
|
18
|
+
@property (nonatomic , strong)QueueConfig *queueConfig;
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PImageTool.h
|
|
3
|
+
// father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/12/7.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <UIKit/UIkit.h>
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface PImageTool : NSObject
|
|
13
|
+
+ (NSData *)Beeprt_DrawPic_pdfByImg:(UIImage*)img Size:(CGSize) targetSize compress:(BOOL)isCompress reverse:(BOOL)isReverse;
|
|
14
|
+
+ (NSData *)codeBy:(NSData *)source;
|
|
15
|
+
+ (UIImage *)imageByScalingBy:(UIImage *)sourceImage ToSize:(CGSize)targetSize;
|
|
16
|
+
+ (UIImage *)addImageBy:(UIImage*)img;
|
|
17
|
+
+ (UIImage *)changeGrayImage:(UIImage *)oldImage ;
|
|
18
|
+
+ (UIImage *)inverColorImage:(UIImage *)image;
|
|
19
|
+
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PReplaceKit.h
|
|
3
|
+
// Father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/10/11.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface PReplaceKit : NSObject
|
|
13
|
+
+(NSString *)replaceQuote:(NSString *)text;
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PSDK.h
|
|
3
|
+
// father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/11/8.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <adapter/ConnectedDevice.h>
|
|
10
|
+
#import <father/Command.h>
|
|
11
|
+
#import <father/Commander.h>
|
|
12
|
+
#import <father/PsdkConst.h>
|
|
13
|
+
#import <father/WriteOptions.h>
|
|
14
|
+
#import <father/Raw.h>
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
17
|
+
|
|
18
|
+
typedef void (^DiscoverBle)(CBPeripheral* peripheral, NSNumber *RSSI);
|
|
19
|
+
typedef void (^DidConnectPeripheral)(CBPeripheral* peripheral);
|
|
20
|
+
typedef void (^DidConnectPeripheral)(CBPeripheral* peripheral);
|
|
21
|
+
typedef void (^DidFailToConnectPeripheral)(CBPeripheral* peripheral,NSError *error);
|
|
22
|
+
typedef void (^DidDisconnectPeripheral)(CBPeripheral* peripheral,NSError *error);
|
|
23
|
+
typedef void (^DidStart)(BOOL result);
|
|
24
|
+
|
|
25
|
+
@interface PSDK : NSObject
|
|
26
|
+
|
|
27
|
+
-(ConnectedDevice *)connectedDevice;
|
|
28
|
+
-(NSString *)sversion;
|
|
29
|
+
-(NSArray *)authors;
|
|
30
|
+
@property(nonatomic , readonly)PSDK *(^raw)(Raw*r);
|
|
31
|
+
@property(nonatomic , readonly)PSDK *(^variable)(NSString *name, id value);
|
|
32
|
+
-(Command *)command;
|
|
33
|
+
@property(nonatomic , readonly)PSDK *(^clear)(void);
|
|
34
|
+
@property(nonatomic , copy)ReceivedData read;
|
|
35
|
+
@property (nonatomic ,readonly)WroteReporter *(^write)(void);
|
|
36
|
+
-(WroteReporter *)write:(WriteOptions *)options;
|
|
37
|
+
@property(nonatomic , copy) DiscoverBle discoverBle;
|
|
38
|
+
@property(nonatomic , copy) DidConnectPeripheral bleDidConnectPeripheral;
|
|
39
|
+
@property(nonatomic , copy) DidFailToConnectPeripheral bleDidFailToConnectPeripheral;
|
|
40
|
+
@property(nonatomic , copy) DidDisconnectPeripheral bleDidDisconnectPeripheral;
|
|
41
|
+
@property(nonatomic , copy) DidStart didStart;
|
|
42
|
+
@property(nonatomic , readonly)PSDK *(^pushArg)(Arg *arg);
|
|
43
|
+
@property(nonatomic , readonly)PSDK *(^pushArgs)(NSArray<Arg *>*args);
|
|
44
|
+
-(void)pushArg:(Arg *)arg;
|
|
45
|
+
-(Commander *)commander;
|
|
46
|
+
/**
|
|
47
|
+
* 开始扫描打印机设备
|
|
48
|
+
*/
|
|
49
|
+
-(void)startScanPrinters;
|
|
50
|
+
/**
|
|
51
|
+
* 停止扫描打印机设备
|
|
52
|
+
*/
|
|
53
|
+
-(void)stopScanPrinters;
|
|
54
|
+
-(void)read:(ReadOptions *)options;
|
|
55
|
+
//@property(nonatomic , readonly)PSDK *(^line)(LineArg *arg);
|
|
56
|
+
//@property(nonatomic , readonly)PSDK *(^batteryVolume)(BatteryArg * arg);
|
|
57
|
+
|
|
58
|
+
@end
|
|
59
|
+
|
|
60
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PVariableKit.h
|
|
3
|
+
// Father
|
|
4
|
+
//
|
|
5
|
+
// Created by aiyin on 2022/4/13.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface PVariableKit : NSObject
|
|
13
|
+
|
|
14
|
+
+ (NSString *)replaceText:(NSString *)text;
|
|
15
|
+
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PsdkConst.h
|
|
3
|
+
// Father
|
|
4
|
+
//
|
|
5
|
+
// Created by aiyin on 2022/4/11.
|
|
6
|
+
//
|
|
7
|
+
#import <Foundation/Foundation.h>
|
|
8
|
+
|
|
9
|
+
@interface PsdkConst : NSObject
|
|
10
|
+
|
|
11
|
+
+ (NSString *)CR;
|
|
12
|
+
+ (NSString *)LF;
|
|
13
|
+
+ (NSString *)CRLF;
|
|
14
|
+
|
|
15
|
+
+ (NSStringEncoding)DEF_CHARSET;
|
|
16
|
+
+ (NSData *)DEF_NEWLINE_BINARY;
|
|
17
|
+
+ (NSArray<NSString *> *)DEF_AUTHORS;
|
|
18
|
+
+ (BOOL)DEF_ENABLED_NEWLINE;
|
|
19
|
+
+ (int)DEF_WRITE_CHUNK_SIZE;
|
|
20
|
+
+ (NSData *)EMPTY_BYTES;
|
|
21
|
+
|
|
22
|
+
@end
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
//FOUNDATION_EXPORT NSStringEncoding gbkEncoding;
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
//FOUNDATION_EXPORT BOOL DEF_ENABLED_NEWLINE;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
//FOUNDATION_EXPORT NSData * const EMPTY_BYTES;
|
|
32
|
+
|
|
33
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Raw.h
|
|
3
|
+
// father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/11/10.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "EasyArg.h"
|
|
9
|
+
#import "DataWriteOperation.h"
|
|
10
|
+
#import "PsdkConst.h"
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
@class Builder;
|
|
13
|
+
@interface Raw : EasyArg
|
|
14
|
+
+(Raw *)createWithText:(NSString *)text;
|
|
15
|
+
+(Raw *)createWithBinary:(NSData *)binary;
|
|
16
|
+
+(Raw *)createWithText:(NSString *)text encoding:(CFStringEncodings)charset;
|
|
17
|
+
@property(nonatomic , strong) Raw *(^newline)(BOOL isNewline);
|
|
18
|
+
-(BOOL)getNewline;
|
|
19
|
+
+(Raw *)make;
|
|
20
|
+
|
|
21
|
+
@end
|
|
22
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SimpleCheck.h
|
|
3
|
+
// father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/11/16.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import "Checker.h"
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
@interface SimpleCheck : Checker
|
|
13
|
+
@property(nonatomic , readonly)SimpleCheck *(^allowedNames)(NSArray< NSString *> *names);
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SingleCommand.h
|
|
3
|
+
// Father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/9/22.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <father/Appendat.h>
|
|
10
|
+
#import <father/CommandClause.h>
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
@interface SingleCommand<T> : NSObject
|
|
14
|
+
@property (nonatomic , strong) NSString *symbolAfterHeader;
|
|
15
|
+
@property (nonatomic , strong) NSString *symbolBetweenArguments;
|
|
16
|
+
|
|
17
|
+
@property (nonatomic , strong) T header;
|
|
18
|
+
@property (nonatomic , readonly) SingleCommand *(^append)(id appender);
|
|
19
|
+
@property (nonatomic , readonly) SingleCommand *(^appendNumber)(int number);
|
|
20
|
+
@property (nonatomic , readonly) SingleCommand *(^appendText)(NSString *text);
|
|
21
|
+
-(instancetype)initWithHeader:(T)header andSymbolAfterHeader:(NSString *)symbolAfterHeader andSymbolBetweenArguments:(NSString *)symbolBetweenArguments;
|
|
22
|
+
-(void)append:(Appendat*)appendat;
|
|
23
|
+
@end
|
|
24
|
+
@interface BasicStringSingleCommand : SingleCommand<NSString *>
|
|
25
|
+
@property (nonatomic , copy) void (^callback)(id _Nullable object);
|
|
26
|
+
|
|
27
|
+
-(NSString *)getOutput;
|
|
28
|
+
-(CommandClause *)clause;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@end
|
|
32
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// WriteOptions.h
|
|
3
|
+
// Father
|
|
4
|
+
//
|
|
5
|
+
// Created by IPRT on 2022/10/25.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import "IDataWriteCallback.h"
|
|
10
|
+
#import "CallbackData.h"
|
|
11
|
+
|
|
12
|
+
typedef void (^callbackData)(CallbackData *datawrite);
|
|
13
|
+
|
|
14
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
15
|
+
|
|
16
|
+
@interface WriteOptions : NSObject
|
|
17
|
+
|
|
18
|
+
@property (nonatomic , readonly) WriteOptions * (^enableChunkWrite)(BOOL isEnableChunkWrite);
|
|
19
|
+
@property (nonatomic , readonly) WriteOptions * (^chunkSize)(int chunkSize);
|
|
20
|
+
@property (nonatomic , readonly) WriteOptions * (^callback)(IDataWriteCallback *cback);
|
|
21
|
+
@property (nonatomic , strong)NSData *writeData;
|
|
22
|
+
-(BOOL)getEnableChunkWrite;
|
|
23
|
+
-(int)getChunkSize;
|
|
24
|
+
-(IDataWriteCallback *)getCallback;
|
|
25
|
+
|
|
26
|
+
@end
|
|
27
|
+
|
|
28
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// father.h
|
|
3
|
+
// father
|
|
4
|
+
//
|
|
5
|
+
// Created by aiyin on 2022/10/30.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <father/PSDK.h>
|
|
10
|
+
#import <father/Lifecycle.h>
|
|
11
|
+
#import <father/DataWriteOperation.h>
|
|
12
|
+
#import <father/EasyArg.h>
|
|
13
|
+
//! Project version number for father.
|
|
14
|
+
FOUNDATION_EXPORT double fatherVersionNumber;
|
|
15
|
+
|
|
16
|
+
//! Project version string for father.
|
|
17
|
+
FOUNDATION_EXPORT const unsigned char fatherVersionString[];
|
|
18
|
+
|
|
19
|
+
// In this header, you should import all the public headers of your framework using statements like #import <father/PublicHeader.h>
|
|
20
|
+
|
|
21
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|