parent
d091fc3da4
commit
5677de4120
@ -0,0 +1,38 @@
|
||||
PODS:
|
||||
- Flutter (1.0.0)
|
||||
- flutter_blue (0.0.1):
|
||||
- Flutter
|
||||
- flutter_blue/Protos (= 0.0.1)
|
||||
- flutter_blue/Protos (0.0.1):
|
||||
- Flutter
|
||||
- Protobuf (~> 3.11.4)
|
||||
- hy_printer (0.0.1):
|
||||
- Flutter
|
||||
- Protobuf (3.11.4)
|
||||
|
||||
DEPENDENCIES:
|
||||
- Flutter (from `Flutter`)
|
||||
- flutter_blue (from `.symlinks/plugins/flutter_blue/ios`)
|
||||
- hy_printer (from `.symlinks/plugins/hy_printer/ios`)
|
||||
|
||||
SPEC REPOS:
|
||||
trunk:
|
||||
- Protobuf
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
Flutter:
|
||||
:path: Flutter
|
||||
flutter_blue:
|
||||
:path: ".symlinks/plugins/flutter_blue/ios"
|
||||
hy_printer:
|
||||
:path: ".symlinks/plugins/hy_printer/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
|
||||
flutter_blue: eeb381dc4727a0954dede73515f683865494b370
|
||||
hy_printer: 93caaf83154d80a633bd57f43cdec0bb8b14b4c2
|
||||
Protobuf: 176220c526ad8bd09ab1fb40a978eac3fef665f7
|
||||
|
||||
PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
|
||||
|
||||
COCOAPODS: 1.11.0
|
@ -0,0 +1,58 @@
|
||||
/*!
|
||||
* \~chinese
|
||||
* @header PTBitmap.h
|
||||
* @abstract 图片处理
|
||||
*
|
||||
* \~english
|
||||
* @header PTBitmap.h
|
||||
* @abstract Image manager
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <CoreGraphics/CoreGraphics.h>
|
||||
#import "SDKDefine.h"
|
||||
|
||||
/// 压缩模式
|
||||
typedef NS_ENUM(NSInteger,PTBitmapCompressMode) {
|
||||
|
||||
PTBitmapCompressModeNone = 0, /*! *\~chinese 不压缩 *\~english None */
|
||||
PTBitmapCompressModeZPL2 = 16, /*! *\~chinese ZPL2压缩算法 *\~english ZPL2 compress */
|
||||
PTBitmapCompressModeTIFF = 32, /*! *\~chinese TIFF压缩算法 *\~english TIFF compress */
|
||||
PTBitmapCompressModeLZO = 48, /*! *\~chinese LZO压缩算法 *\~english LZO compress */
|
||||
};
|
||||
|
||||
/// 图片效果
|
||||
typedef NS_ENUM(NSInteger, PTBitmapMode) {
|
||||
|
||||
PTBitmapModeBinary = 0, /*! *\~chinese 黑白二值图像 *\~english Binary */
|
||||
PTBitmapModeDithering = 1, /*! *\~chinese 灰阶抖动图像 *\~english Dithering */
|
||||
PTBitmapModeColumn = 2, /*! *\~chinese 无效 *\~english not supported */
|
||||
};
|
||||
|
||||
@interface PTBitmap : NSObject
|
||||
|
||||
/// 生成打印机打印图片数据
|
||||
/// @param image 图片
|
||||
/// @param mode 图片效果
|
||||
/// @param compress 压缩模式
|
||||
/// @param package 数据是否分包
|
||||
/// @param inversion 数据是否需要取反
|
||||
+ (NSData *)getImageData:(CGImageRef)image mode:(PTBitmapMode)mode compress:(PTBitmapCompressMode)compress package:(BOOL)package inversion:(BOOL)inversion;
|
||||
|
||||
|
||||
/// 用column算法生成的图片数据
|
||||
/// @param sourceBitmap 输入数据
|
||||
+ (NSData *)generateColumnData:(CGImageRef)sourceBitmap;
|
||||
|
||||
|
||||
/// 将bitmap数据转成图片
|
||||
/// @param image 图片
|
||||
/// @param mode 生成的位图数据类型 简单的黑白二值化或者抖动处理
|
||||
+ (UIImage *)generateRenderingWithImage:(CGImageRef)image mode:(PTBitmapMode)mode;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,51 @@
|
||||
/*!
|
||||
* \~chinese
|
||||
* @header PTPrinter.h
|
||||
* @abstract 打印机属性
|
||||
*
|
||||
* \~english
|
||||
* @header PTPrinter.h
|
||||
* @abstract Printer properties
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <CoreBluetooth/CoreBluetooth.h>
|
||||
#import "PTRouter.h"
|
||||
|
||||
/// 打印机的连接模块
|
||||
typedef NS_ENUM(NSInteger, PTPrinterModule) {
|
||||
|
||||
PTPrinterModuleUnknown = 0, /// 未知类型
|
||||
PTPrinterModuleBLE = 1, /// 蓝牙
|
||||
PTPrinterModuleWiFi = 2, /// 无线
|
||||
PTPrinterModuleBoth = 3, /// 蓝牙和无线
|
||||
};
|
||||
|
||||
@interface PTPrinter : NSObject<NSCoding>
|
||||
|
||||
/// 打印机名称
|
||||
@property(strong,nonatomic,readwrite) NSString *name;
|
||||
/// 打印机mac地址
|
||||
@property(strong,nonatomic,readwrite) NSString *mac;
|
||||
/// 打印机蓝牙模块
|
||||
@property(assign,nonatomic,readwrite) PTPrinterModule module;
|
||||
/// 发现蓝牙时获取到的广播信息
|
||||
@property(strong,nonatomic,readwrite) NSDictionary *advertisement;
|
||||
/// 蓝牙外设UUID
|
||||
@property(strong,nonatomic,readwrite) NSString *uuid;
|
||||
/// 发现外设时获取到的信号强度值,单位分贝
|
||||
@property(strong,nonatomic,readwrite) NSNumber *rssi;
|
||||
/// 信号强度等级分0-5级
|
||||
@property(strong,nonatomic,readwrite) NSNumber *strength;
|
||||
/// 由信号强度计算的距离
|
||||
@property(strong,nonatomic,readwrite) NSNumber *distance;
|
||||
/// 蓝牙外设
|
||||
@property(strong,nonatomic,readwrite) CBPeripheral *peripheral;
|
||||
/// 外设的ip地址
|
||||
@property(strong,nonatomic,readwrite) NSString *ip;
|
||||
/// 端口
|
||||
@property(strong,nonatomic,readwrite) NSString *port;
|
||||
|
||||
- (instancetype)initWithPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary<NSString *,id> *)advertisementData RSSI:(NSNumber *)RSSI;
|
||||
|
||||
@end
|
@ -0,0 +1,96 @@
|
||||
/*!
|
||||
* \~chinese
|
||||
* @header PTRouter.h
|
||||
* @abstract 路由器属性
|
||||
*
|
||||
* \~english
|
||||
* @header PTRouter.h
|
||||
* @abstract Router properties
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface PTRouter : NSObject
|
||||
|
||||
/*!
|
||||
* \~chinese
|
||||
* 广播地址
|
||||
*
|
||||
* \~english
|
||||
* Broadcast address
|
||||
*/
|
||||
@property(strong,nonatomic,readwrite) NSString *broadcastIP;
|
||||
|
||||
/*!
|
||||
* \~chinese
|
||||
* 本机地址
|
||||
*
|
||||
* \~english
|
||||
* Local address
|
||||
*/
|
||||
@property(strong,nonatomic,readwrite) NSString *localIP;
|
||||
|
||||
/*!
|
||||
* \~chinese
|
||||
* 子网掩码
|
||||
*
|
||||
* \~english
|
||||
* Netmask
|
||||
*/
|
||||
@property(strong,nonatomic,readwrite) NSString *netmask;
|
||||
|
||||
/*!
|
||||
* \~chinese
|
||||
* 接口
|
||||
*
|
||||
* \~english
|
||||
* Interface
|
||||
*/
|
||||
@property(strong,nonatomic,readwrite) NSString *interface;
|
||||
|
||||
/*!
|
||||
* \~chinese
|
||||
* 网关
|
||||
*
|
||||
* \~english
|
||||
* Gateway
|
||||
*/
|
||||
@property(strong,nonatomic,readwrite) NSString *gateway;
|
||||
|
||||
/*!
|
||||
* \~chinese
|
||||
* 是否连接路由器
|
||||
*
|
||||
* \~english
|
||||
* Whether to connect to the router
|
||||
*/
|
||||
@property(assign,nonatomic,readwrite) BOOL connected;
|
||||
|
||||
/*!
|
||||
* \~chinese
|
||||
* mac地址
|
||||
*
|
||||
* \~english
|
||||
* Mac
|
||||
*/
|
||||
@property(strong,nonatomic,readwrite) NSString *MAC;
|
||||
|
||||
/*!
|
||||
* \~chinese
|
||||
* 热点名称
|
||||
*
|
||||
* \~english
|
||||
* ssid
|
||||
*/
|
||||
@property(strong,nonatomic,readwrite) NSString *SSID;
|
||||
|
||||
/*!
|
||||
* \~chinese
|
||||
* 热点详情
|
||||
*
|
||||
* \~english
|
||||
* SSIDDATA
|
||||
*/
|
||||
@property(strong,nonatomic,readwrite) NSString *SSIDDATA;
|
||||
|
||||
@end
|
@ -0,0 +1,51 @@
|
||||
|
||||
|
||||
#if TARGET_OS_IOS
|
||||
#import <UIKit/UIKit.h>
|
||||
#elif TARGET_OS_MAC
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#endif
|
||||
|
||||
#import <Foundation/NSObjCRuntime.h>
|
||||
|
||||
//! Project version number for PrinterSDK.
|
||||
FOUNDATION_EXPORT double PrinterSDKVersionNumber;
|
||||
|
||||
//! Project version string for PrinterSDK.
|
||||
FOUNDATION_EXPORT const unsigned char PrinterSDKVersionString[];
|
||||
|
||||
// In this header, you should import all the public headers of your framework using statements like #import <PrinterSDK/PublicHeader.h>
|
||||
|
||||
/*! *\~chinese ESC指令 *\~english ESC command */
|
||||
#import <PrinterSDK/PTCommandESC.h>
|
||||
|
||||
/*! *\~chinese TSPL指令 *\~english TSPL command */
|
||||
#import <PrinterSDK/PTCommandTSPL.h>
|
||||
|
||||
/*! *\~chinese ZPL指令 *\~english ZPL command */
|
||||
#import <PrinterSDK/PTCommandZPL.h>
|
||||
|
||||
/*! *\~chinese CPCL指令 *\~english CPCL command */
|
||||
#import <PrinterSDK/PTCommandCPCL.h>
|
||||
#import <PrinterSDK/PTLabel.h>
|
||||
|
||||
#import <PrinterSDK/PTCommandCommon.h>
|
||||
#import <PrinterSDK/PTOldCommandCPCL.h>
|
||||
#import <PrinterSDK/PTOldCommandTSPL.h>
|
||||
|
||||
/*! *\~chinese 图片处理 *\~english image manager */
|
||||
#import <PrinterSDK/PTBitmap.h>
|
||||
#import <PrinterSDK/PTBitmap+GrayLevel.h>
|
||||
#import <PrinterSDK/PTEncode.h>
|
||||
|
||||
// Dispatch
|
||||
|
||||
/*! *\~chinese 通讯 *\~english Communication */
|
||||
#import <PrinterSDK/PTDispatcher.h>
|
||||
#import <PrinterSDK/PTPrinter.h>
|
||||
#import <PrinterSDK/PTRouter.h>
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
#ifndef PublicDefine_h
|
||||
#define PublicDefine_h
|
||||
|
||||
#ifdef DEBUG
|
||||
#define NSLog(FORMAT, ...) fprintf(stderr,"%s:%d\t %s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
|
||||
#else
|
||||
#define NSLog(...)
|
||||
#endif
|
||||
|
||||
#endif /* PublicDefine_h */
|
Binary file not shown.
@ -0,0 +1,6 @@
|
||||
framework module PrinterSDK {
|
||||
umbrella header "PrinterSDK.h"
|
||||
|
||||
export *
|
||||
module * { export * }
|
||||
}
|
Binary file not shown.
Loading…
Reference in new issue