UNPKG

@citrineos/base

Version:

The base module for OCPP v2.0.1 including all interfaces. This module is not intended to be used directly, but rather as a dependency for other modules.

86 lines 2.22 kB
// SPDX-FileCopyrightText: 2025 Contributors to the CitrineOS Project // // SPDX-License-Identifier: Apache-2.0 import { OcppError } from '../../ocpp/rpc/message.js'; import { EventGroup, MessageOrigin, MessageState } from '../messages/internal-types.js'; /** * Default implementation of IMessage */ export class Message { /** * Fields */ _origin; _eventGroup; _action; _state; _context; _payload; _protocol; /** * Constructs a new instance of Message. * * @param {MessageOrigin} origin - The origin of the message. * @param {EventGroup} eventGroup - The event group of the message. * @param {CallAction} action - The action of the message. * @param {MessageState} state - The state of the message. * @param {IMessageContext} context - The context of the message. * @param {T} payload - The payload of the message. * @param {OCPPVersionType} [protocol] - The protocol of the message, example "ocpp1.6". */ constructor(origin, eventGroup, action, state, context, payload, protocol) { this._origin = origin; this._eventGroup = eventGroup; this._action = action; this._state = state; this._context = context; this._payload = payload; this._protocol = protocol; } /** * Getter & Setter */ get origin() { return this._origin; } get eventGroup() { return this._eventGroup; } get action() { return this._action; } get state() { return this._state; } get context() { return this._context; } get payload() { return this._payload; } get protocol() { return this._protocol; } set origin(value) { this._origin = value; } set eventGroup(value) { this._eventGroup = value; } set action(value) { this._action = value; } set state(value) { this._state = value; } set context(value) { this._context = value; } set payload(value) { this._payload = value; } set protocol(value) { this._protocol = value; } } //# sourceMappingURL=Message.js.map