B4A Library Bosch GLM100C - MT-Protocol to read Devicemeasurent from Bosch Rangefinder using Bluetooth

This is a B4A Library which uses the Bosch MT-Protocol to read Measurements from Bosch Rangefinders using Bluetooth/BLE.
firefox_jxKwZ9fDUb.png


The Library should work with these Devices:

B4X:
 static {
        GLM_100_DEV_TYPES.put("3601K72Y00", "Bosch GLM 100-25 C");
        GLM_100_DEV_TYPES.put("00Y27K1063", "Bosch GLM 100-25 C");
        GLM_100_DEV_TYPES.put("3601K72Y50", "Bosch GLM 100-25 C");
        GLM_100_DEV_TYPES.put("05Y27K1063", "Bosch GLM 100-25 C");
        GLM_100_DEV_TYPES.put("3601K72YK0", "Bosch GLM 100-25 C");
        GLM_100_DEV_TYPES.put("0KY27K1063", "Bosch GLM 100-25 C");
    }

    /**
     * Static map for GLM 50-2 family devices. Bare tool number is key. Device name is value.
     */
    public static final Map<String, String> GLM_50_2_DEV_TYPES = new HashMap<>();
    static {
        GLM_50_2_DEV_TYPES.put("3601K72T00", "Bosch GLM50-27 C");
        GLM_50_2_DEV_TYPES.put("00T27K1063", "Bosch GLM50-27 C");
        GLM_50_2_DEV_TYPES.put("3601K72U00", "Bosch GLM50-27 CG");
        GLM_50_2_DEV_TYPES.put("00U27K1063", "Bosch GLM50-27 CG");
        GLM_50_2_DEV_TYPES.put("3601K72T10", "Bosch Blaze165-27C");
        GLM_50_2_DEV_TYPES.put("01T27K1063", "Bosch Blaze165-27C");
        GLM_50_2_DEV_TYPES.put("3601K72U10", "Bosch Blaze165-27CG");
        GLM_50_2_DEV_TYPES.put("01U27K1063", "Bosch Blaze165-27CG");
        GLM_50_2_DEV_TYPES.put("3601K72UK0", "Bosch GLM50-27 CG AP");
        GLM_50_2_DEV_TYPES.put("0KU27K1063", "Bosch GLM50-27 CG AP");
        GLM_50_2_DEV_TYPES.put("3601K72U50", "Bosch GLM50-27 CG JP");
        GLM_50_2_DEV_TYPES.put("05U27K1063", "Bosch GLM50-27 CG JP");
    }

The Library is given to the community by @Wolli013 who paid the developement and give it for FREE to any registered B4X Member. Thank you Wolli!

BoschGLM
...|http://www.b4x.com
Author: DonManfred
Version: 1.0
  • GLM100C
    • Events:
      • devicefound (MTBluetoothDevice As Object)
      • measure (value As Float)
      • status (value As String)
    • Fields:
      • ACTION_CONNECTION_STATUS_UPDATE As String
      • ACTION_DEVICE_LIST_UPDATED As String
      • EXTRA_CONNECTION_STATUS As String
      • EXTRA_DEVICE As String
      • REQUEST_ENABLE_BT As Int
    • Functions:
      • cancelDiscovery
        Stop Bluetooth scan
      • connect (mtDevice As com.bosch.glm100c.bluetooth.MTBluetoothDevice) As Boolean
        Open connection to MTBluetoothDevice mtDevice
        BluetoothConnection (classic connection) is opened if the connected mtDevice supports dual mode
        BLEConnection (BLE connection) is opened, if the connected mtDevice supports only BLE
        Return type: @return:true if successful, false otherwise
      • disconnect
        Close an existing connection
      • Initialize (EventName As String, debug As Boolean)
      • isBluetoothEnabled As Boolean
        Checks if Bluetooth is enabled (switched on) on the Android device
        Return type: @return:true if adapter is enabled, false otherwise
      • onConnectionStateChanged (connection As com.bosch.mtprotocol.glm100C.connection.MtAsyncConnection)
        Callback that handles connection state changes
        connection: connection, which state changed
      • onDeviceDiscovered (result As com.bosch.glm100c.bluetooth.IScanResult)
      • onpause
      • scanLeDevice (enable As Boolean)
        Operating function to start or stop BLE device scan.
        Triggering scan will start scanning for a period of {@value #PERIOD_TO_SCAN_IN_MS} and quit scan after this period.
        Stopping scan will quit scan immediately
        enable: will trigger BLE scanner if true and stop the scanner otherwise
      • startDiscovery As Boolean
        Start Bluetooth scan
    • Properties:
      • Connected As Boolean [read only]
        Will check if service is connected
      • Connection As com.bosch.mtprotocol.MtConnection [read only]
        Will return the current Connection
      • ConnectionState As Int [read only]
        Will return current connection state
      • CurrentDevice As com.bosch.glm100c.bluetooth.MTBluetoothDevice [read only]
      • VisibleDevices As java.util.Set [read only]
        Get currently discovered Bluetooth devices
  • MTBluetoothDevice
    • Functions:
      • IsInitialized As Boolean
    • Properties:
      • Device As com.bosch.glm100c.bluetooth.MTBluetoothDevice [read only]
      • DeviceAddress As String [read only]
      • DeviceAlias As String [read only]
      • DeviceName As String [read only]
      • DisplayName As String
 

Attachments

  • BoschGLMV1.0.zip
    185.3 KB · Views: 144
  • BoschGLM-Project.zip
    17.4 KB · Views: 135
Last edited:

Cclaws

Member
Don - this is awesome. Any chance of adding support for indirect measurements (indirect length, indirect heigh, double indirect height)? When I try those in the example app, no data appears for those measurements from the device.
 

Wolli013

Well-Known Member
Licensed User
Longtime User
Hello i have a Problem SDK 34
One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts.
Please Help me.
 

DonManfred

Expert
Licensed User
Longtime User
Hello i have a Problem SDK 34
You should ALWAYS start a new thread for any issue you have.
It is not related to this library.
It is a new requirement from google for which you should find something about in Google documentation.
 
Top