75d24c15
yangbin
123
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
|
//
// VxpOperator.h
// MTKBleManager
//
// Created by user on 14/10/29.
// Copyright (c) 2014年 ___MTK___. All rights reserved.
//
// VXP looks like an app which can run in the wearable device
//
#import <Foundation/Foundation.h>
const static int VXP_TYPE_NORMAL = 1;
const static int VXP_TYPE_TINY = 2;
@protocol VxpChangeListener <NSObject>
/**
BLE connection state change
*/
-(void)notifyConnectionStateChange:(int)connectionState;
/**
Uninstall the VXP from wearable device result callback
result : 1 success, 0 failed
name : Vxp name
code : error code
*/
-(void)notifyUnistallResult:(BOOL)result vxpName:(NSString*)name errorCode:(int)code;
/**
Uninstall all VXP from wearable device result callback
result : 1 success, 0 failed
*/
-(void)notifyUnistallAllResult:(BOOL)result;
/**
While the VXP has been transferd, wearable device should begin to install, while the
installation finished, should notify the install result to user
*/
-(void)notifyInstallResult:(BOOL)result vxpName:(NSString*)name errorCode:(int)code;
/**
While send the delete vxp command to wearable device, should return the delete result to user
*/
-(void)notifyDeleteResult:(BOOL)result vxpName:(NSString*)name;
/**
While transfer the VXP file, should notify the VXP transfer progress which maybe need show it in the UX
*/
-(void)notifyProgressChange:(float)progress;
/**
Get the VXP list install result
*/
-(void)notifyVxpList:(NSArray*)vxpList resultList:(NSArray*)results;
/**
Get all VXP information
*/
-(void)notifyAllVxpInformation:(NSArray*)results;
@end
@interface VxpOperator : NSObject
+(id)getInstace;
/******************************************************************************
**
** Register & unregister change listeners
**
******************************************************************************/
-(void)registerChangeListener:(id<VxpChangeListener>)listener;
-(void)unregisterChangeListener:(id<VxpChangeListener>)listener;
/**
Install vxp : maybe contains 2 steps, transfer the VXP file to wearble device
and trigger to install the VXP
vxpName : the VXP name
data : The VXP file data which should be transfer to wearable device
type : The VXP type which should only be NORMAL & TINY
*/
-(void)installVxp:(NSString*)vxpName vxpFileData:(NSData*)data vxpType:(int)type;
/**
Uninstall VXP : uninstall the VXP
vxpName : The VXP name
*/
-(void)uninstallVxp:(NSString*)vxpName;
/**
Uninstall all VXP which has been installed in the wearable device
*/
-(void)uninstallAllVxp;
/**
Get the VXP install status according to the VXP name list
vxpNameList : The vxp name list which want to query
*/
-(void)getVxpInstallStatus:(NSArray*)vxpNameList;
/**
Delete the VXP file while the installation failed
vxpName : vxp name which want to delete
*/
-(void)deleteVxp:(NSString*)vxpName;
/**
Get all VXP information which has been installed in the wearable device
*/
-(void)getAllVxpInformation;
@end
|