How to get data from an object returned from a Bluetooth device using BLE

I have managed to write a program that connects to my power meter via Bluetooth, I have set up a profile for the power data and retrieved it via BLE. When I try and decode the output I get the following error:

"Details: Could not find symbol 'decodeNumber'"

I imagine this means that the value I am getting in my power characteristic is not a ByteArray but an Object, I am unsure how to get the data I need from this if that is the case. Here is my profile manager code:


import Toybox.BluetoothLowEnergy;

class ProfileManager {

public const POWER_METER_SERVICE = BluetoothLowEnergy.longToUuid(0x6E400001B5A3F393L, 0xE0A9E50E24DCCA9EL);

public const CYCLING_POWER_SERVICE = BluetoothLowEnergy.longToUuid(0x0000181800001000L, 0x800000805F9B34FBL);
public const CYCLING_POWER_MEASURMENT_CHARACTERISTIC = BluetoothLowEnergy.longToUuid(0x00002A6300001000L, 0x800000805F9B34FBL);
public const CYCLING_POWER_FEATURE_CHARACTERISTIC = BluetoothLowEnergy.longToUuid(0x00002A6500001000L, 0x800000805F9B34FBL);
public const CYCLING_POWER_CP_CHARACTERISTIC = BluetoothLowEnergy.longToUuid(0x00002A6600001000L, 0x800000805F9B34FBL);

private const _cyclingPowerDef = {
:uuid => CYCLING_POWER_SERVICE,
:characteristics => [{
:uuid => CYCLING_POWER_MEASURMENT_CHARACTERISTIC
}, {
:uuid => CYCLING_POWER_FEATURE_CHARACTERISTIC
}, {
:uuid => CYCLING_POWER_CP_CHARACTERISTIC
}]
};

//! Register the bluetooth profile
public function registerProfiles() as Void {
BluetoothLowEnergy.registerProfile(_cyclingPowerDef);
}

And my startRead code in device manager:

private function startRead() as Void {
System.println("Start Read");
var device = _device;
if (device != null) {
_cycleService = device.getService(_profileManager.CYCLING_POWER_SERVICE);
var cycleService = _cycleService;
if (cycleService != null) {
_feature = cycleService.getCharacteristic(_profileManager.CYCLING_POWER_FEATURE_CHARACTERISTIC);
_powerMeterData = cycleService.getCharacteristic(_profileManager.CYCLING_POWER_MEASURMENT_CHARACTERISTIC);
}
if (_powerMeterData instanceof Toybox.Lang.ByteArray){
System.println("yup");
}


value.decodeNumber(Lang.NUMBER_FORMAT_UINT8, {});
var pd = _powerMeterData.decodeNumber(Lang.NUMBER_FORMAT_UINT16, {});
System.println(pd);

System.println(_powerMeterData.toString());
}

Any help would be greatly appreciated