|
hace 3 años | |
---|---|---|
iFreshDemo_1.0 | hace 3 años | |
README.md | hace 4 años | |
README_CN.md | hace 4 años |
- iOS 8.0 and above.
- The Bluetooth version used by the device requires 4.0 and above.
- Need to add iFreshSDK.framework package dependency;
1.iFreshSDK.framework (package name raytao.pingwang.iFreshDemo);
For details, please see the “Good Nutrition SDK Release Notes.doc” document.
[[iFreshSDK shareManager] bleDoScan];
[[iFreshSDK shareManager] setbleReturnValueDelegate:self];
/**
unitChang after switching unit */
(void)changeUnitWithBle:(GN_UnitEnum) unitChange;
/**
bleStatus current Bluetooth status */
(void)bleStatusupdate:(GN_BleStatus)bleStatus;
/** ble Penetrate Data
@param data Penetrate data */ -(void)bluetoothManagerReturePenetrateData:(NSData *)data;
## Communication with equipment:
/*
data input */
(void)sendDataToBle:(NSData *)data; /**
Start scanning, it is recommended to put in the program entrance */
(void)bleDoScan;
/**
/**
/**
/**
/*
4294967295
*//*
4294967295
*//*
/*
/*
/*
/* *Set fat */
/* *Set protein */
(void)setProtein:(NSInteger)protein; /* *Set carbohydrates */
(void)setCarbohydrates:(NSInteger)carbohydertes; /* *Set dietary fiber */
(void)setFiber:(NSInteger)fiber; /* *Set cholesterol */
(void)setCholesterd:(NSInteger)cholesterd; /* *Set the sodium content */
(void)setSodium:(NSInteger)sodium; /* *Set the sugar content */
(void)setSugar:(NSInteger)sugar;
/*
(void)turnOffDevice;
## Tools and fat model "iFreshModel"
The following data is the data returned by the proxy method after the SDK is processed:
// Bluetooth callback value: @property (nonatomic, copy) NSString *value; / / Data in “g” @property (nonatomic, assign) NSInteger gValue; / / Record the last used unit (SDK internal call), @property (nonatomic,copy) NSString *Unit;
To convert data according to the unit, please call the following method: /**
/**
(NSString *)kgTolb:(NSString *)weightValue;
## Coffee scale timing function
Send instructions to Bluetooth
//start -(void)bluetoothCoffeeStartTime; //pause -(void)bluetoothCoffeePauseTime; //Reset -(void)bluetoothCoffeeResetTime;
//Countdown starts -(void)bluetoothCoffeeCountdownStartTime:(int)min second:(int)sec;
Receive data sent by Bluetooth
/** *Agent callback supported by coffee scale *workType: Operation instructions for the coffee scale */ -(void)bluetoothManagerCoffeeTimingWork:(BleCoffeeTimingWorkType)workType; /** *Time returned by the coffee scale *min: minute *sec: seconds *countdown: Whether it is countdown, YES: countdown, NO: timing */ -(void)bluetoothManagerCoffeeTime:(int)min second:(int)sec isCountdown:(BOOL)countdown; /**