2017-03-10 14:53:19 +01:00
|
|
|
/* Copyright (C) 2016-2017 Andreas Shimokawa
|
|
|
|
|
|
|
|
This file is part of Gadgetbridge.
|
|
|
|
|
|
|
|
Gadgetbridge is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Gadgetbridge is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2016-11-15 11:56:14 +01:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.service.devices.pebble;
|
|
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
2017-03-28 09:51:06 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent;
|
2016-11-15 11:56:14 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
|
|
|
|
import nodomain.freeyourgadget.gadgetbridge.util.GB;
|
|
|
|
|
|
|
|
class DatalogSessionHealthHR extends DatalogSessionPebbleHealth {
|
|
|
|
|
|
|
|
private static final Logger LOG = LoggerFactory.getLogger(DatalogSessionHealthHR.class);
|
|
|
|
|
2017-02-20 08:47:42 +01:00
|
|
|
DatalogSessionHealthHR(byte id, UUID uuid, int timestamp, int tag, byte item_type, short item_size, GBDevice device) {
|
|
|
|
super(id, uuid, timestamp, tag, item_type, item_size, device);
|
2016-11-15 11:56:14 +01:00
|
|
|
taginfo = "(Health - HR " + tag + " )";
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-03-28 09:51:06 +02:00
|
|
|
public GBDeviceEvent[] handleMessage(ByteBuffer datalogMessage, int length) {
|
2016-11-15 11:56:14 +01:00
|
|
|
LOG.info("DATALOG " + taginfo + GB.hexdump(datalogMessage.array(), datalogMessage.position(), length));
|
|
|
|
|
2017-03-28 09:51:06 +02:00
|
|
|
return isPebbleHealthEnabled() ? new GBDeviceEvent[]{null} : null;
|
2016-11-15 11:56:14 +01:00
|
|
|
}
|
|
|
|
}
|