package com.grigowashere.aismap.ble.hub;

import java.util.UUID;

/**
 * BLE AIS Hub (protocol v2) — UUID and message type constants.
 */
public final class AisHubConstants {

    private AisHubConstants() {}

    public static final UUID SERVICE_UUID =
            UUID.fromString("34b5f2a0-5b23-4c5a-9b2a-3c4c1a9c0001");
    public static final UUID CONTROL_UUID =
            UUID.fromString("34b5f2a0-5b23-4c5a-9b2a-3c4c1a9c0002");
    public static final UUID DATA_UUID =
            UUID.fromString("34b5f2a0-5b23-4c5a-9b2a-3c4c1a9c0003");
    public static final UUID STATUS_UUID =
            UUID.fromString("34b5f2a0-5b23-4c5a-9b2a-3c4c1a9c0004");

    public static final int HEADER_SIZE = 10;

    /**
     * Protocol version byte values (first byte of every DATA frame header).
     * The server writes this per-frame based on the encoding it chose for
     * that message (negotiated via the "hello" command, or from the
     * AIS_BLE_BROADCAST_ENCODING env for CCCD broadcast).
     */
    public static final int PROTO_VERSION_JSON    = 0x01;
    public static final int PROTO_VERSION_MSGPACK = 0x02;

    /** Server → client DATA msg_type */
    public static final int MSG_HELLO_ACK = 0x01;
    public static final int MSG_SNAPSHOT_BEGIN = 0x02;
    public static final int MSG_SNAPSHOT_CHUNK = 0x03;
    public static final int MSG_SNAPSHOT_END = 0x04;
    public static final int MSG_EVENT = 0x05;
    public static final int MSG_STATUS = 0x06;
    public static final int MSG_ERROR = 0x07;
    public static final int MSG_PONG = 0x08;
}
