This package contains StarMgsIO SDK Ver 1.3.0.
StarMgsIO.xcframework is a framework for supporting application development for Star scales.
MG_series_Scale_StarMgsIO_iOS_SDK_V1_3_0/
├── Documents/
│ └── readme.url // Link to release Notes
├── Software/
│ ├── SDK/ // Samples (Ver.1.3.0)
│ └── Distributables/
│ └── StarMgsIO.xcframework (Ver.1.1.0)
└── SoftwareLicenseAgreement_En.pdf // Software License Agreement
Supported models :
Supported OS :
Supported Xcode :
StarMgsIO SDK library supports CocoaPods and Framework. Please link library that suits your application configuration.
pod 'StarMgsIO', 'StarMgsIOVersion'
Please refer to Podfile in SDK for the latest library version.
And then run
pod install
At the beginning of the source code, import the header file as follows.
#import <StarMgsIO/StarMgsIO.h>
Open the project file by Xcode.
Select target from "TARGETS" in project setting view.
Select "Build Phases" and click '+' button in "Link Binary with Libraries".
Click "Add Other ..." button and select StarMgsIO.xcframework from the file dialog.
At the beginning of the source code, import the header file as follows.
#import <StarMgsIO/StarMgsIO.h>
This class is used to manage a scale.
Shared accessory manager |
---|
+ (STARDeviceManager *)sharedManager; Return the shared STARDeviceManager object. |
Public properties and methods |
---|
- (void)scanForScales; Start scanning scales.
|
- (void)stopScan; Stop scanning scales.
|
- (void)connectScale:(nonnull STARScale *)scale; Connect to a scale and set delegate to notify the communication result with it. The result will be notified to delegate object.
|
- (void)connectScaleWithIdentifier:(nonnull NSString *)identifier; Connect to a scale and set delegate to notify the communication result with it. The result will be notified to delegate object. identifier: The UUID that can be obtained from the identifier property of the STARScale object.
|
- (void)disconnectScale:(nonnull STARScale *)scale; Disconnect a scale. The result will be notified to delegate object.
|
@property(nonatomic, readonly) NSString *versionString; Get StarMgsIO.xcframework version name. |
@property(nonatomic, weak) id<STARDeviceManagerDelegate> delegate; Delegate object to receive the results of methods. |
This protocol is used to receive the result of processes done in the STARDeviceManager class.
Public methods |
---|
- (void)manager:(nonnull STARDeviceManager *)manager didDiscoverScale:(STARScale *)scale error:(NSError *)error; Captures the result of the scanForScales() method. Add complete code from MG-series-SDK, TableViewController, line 100, function
|
- (void)manager:(nonnull STARDeviceManager *)managerr> didConnectScale:(STARScale *)scale error:(NSError *)error; Captures the result of the connectScale() method when connecting to a STARScale object. Add complete code from MG-series-SDK, TableViewController, line 117, function
|
- (void)manager:(nonnull STARDeviceManager *)manager didDisconnectScale:(STARScale *)scale error:(NSError *)error; Delegate method is notified when a STARScale object is disconnected using disconnectScale() method or when BLE connection is lost.
|
This class is used to communicate with a scale.
Public properties and methods |
---|
@property(nonatomic, readonly) NSString * _Nullable name; The name of the scale. |
@property(nonatomic, readonly) NSString * _Nullable identifier; The identifier(UUID) of the scale. |
@property(nonatomic, readonly) STARScaleType_ENUM scaleType; The model of the scale. |
@property(nonatomic, weak) id<STARScaleDelegate> _Nullable delegate; Delegate object to receive the results of methods. |
- (void)updateSetting:(STARScaleSetting)setting; Change scale settings. The result will be notified to delegate object. |
This protocol is used to receive the result of processes done in the STARScale class.
Public methods |
---|
- (void)scale:(STARScale *)scale didReadScaleData:(STARScaleData *)scaleData error:(NSError *)error; Notify that weight data is received from a scale. |
- (void)scale:(STARScale *)scale didUpdateSetting:(STARScaleSetting)setting error:(NSError *)error; Notify execution result of updateSetting method. |
This enum is used to specity the scale setting.
Constants |
---|
STARScaleSettingZeroPointAdjustment Zero Point Adjustment |
This class manages weight data received from a scale.
Public properties and methods |
---|
@property(nonatomic, readonly) double weight; Weight |
@property(nonatomic, readonly) STARUnit unit; Unit of weight |
@property(nonatomic, readonly) STARComparatorResult comparatorResult; Result of comparator function |
@property(nonatomic, readonly) STARDataType dataType; Type of the data |
@property(nonatomic, readonly) STARStatus status; Scale status |
@property(nonatomic, readonly) NSInteger numberOfDecimalPlaces; Number of decimal places of weight |
@property(nonatomic, readonly) NSString *rawString; Raw string |
This enum is used to specify the unit of weight.
Constants |
---|
STARUnitInvalid Invalid value |
STARUnitMG Milligram |
STARUnitG Gram |
STARUnitKG Kilogram |
STARUnitCT Carat |
STARUnitMOM Momme |
STARUnitOZ Ounce |
STARUnitLB Pound |
STARUnitOZT Troy ounce |
STARUnitDWT Penny weight |
STARUnitGN Grain |
STARUnitTLH Hong Kong tael |
STARUnitTLS Singapore tael |
STARUnitTLT Taiwan tael |
STARUnitTO Tola |
STARUnitMSG Mesghal |
STARUnitBAT Baht |
STARUnitPCS Parts counting |
STARUnitPercent Percentage weighing |
STARUnitCoefficient Multiplied by Coefficient |
This enum is used to specify the result of comparator function.
Constants |
---|
STARComparatorResultInvalid Invalid value |
STARComparatorResultShortage Shortage |
STARComparatorResultProper Proper |
STARComparatorResultOver Over |
This enum is used to specify the scale type.
Constants |
---|
STARScaleTypeInvalid Invalid value |
STARScaleTypeMGS MG-S322,MG-S1501,MG-S8200 |
STARScaleTypeMGTS MG-T12,MG-T30,MG-T60 |
This class is used to determine the scale type.
Public methods |
---|
+ (STARScaleType_ENUM)getEnum:(NSString *)name; Get the ScaleType of Enum type from the String name (MGS or MGTS). |
This enum is used to specify the type of the data.
Constants |
---|
STARDataTypeInvalid Invalid value |
STARDataTypeNetNotTared Net weight (not tared) |
STARDataTypeNet Net weight (tared) |
STARDataTypeTare Tare weight |
STARDataTypePresetTare Preset tare weight |
STARDataTypeTotal Total value |
STARDataTypeUnit Unit weight |
STARDataTypeGross Gross |
This enum is used to specify the status of weight data.
Constants |
---|
STARStatusInvalid Invalid value |
STARStatusStable Data stable |
STARStatusUnstable Data unstable |
STARStatusError Data error |
This enum represents the type of error and is used for the code property of the NSError object.
Constants |
---|
STARNotAvailableError The host device does not have the function to connect to a scale. |
STARAlreadyConnectedError Attempt to connect to a scale even though already connected to it. |
STARTimeoutError Operation timed out. |
STARNotSupportedError Attempt to connect to not supported device. |
STARUnexpectedError Operation is failed due to unexpected error. |
STARUnexpectedDisconnectionError Scale is disconnected unexpextedly. |
STARNotConnectedError Attempt to operate a scale even though not connected to it. |
STARRequestRejectedError Change scale settings operation is failed due to request is rejected. |
Copyright 2019 - 2021 Star Micronics Co., Ltd. All rights reserved.
Ver.1.3.0(US market only)
2021/12/20
Ver.1.2.0 (US market only)
2019/12/25
Ver.1.0.1 (US market only)
2019/10/11
Ver.1.0.0 (US market only)
2018/06/29