ExCEP. Model
(ex_cep v0.1.1)
Copy Markdown
CSG CEP Plug-and-Play Device Model structure aligned with TS2.1 (Section 8, Tables 27–28, Section 9, Appendix B).
Model Naming Convention (TS2.1 Section 8.1)
<manufacturerId>_<devType>_<fileType>_<version>
manufacturerId: 1..6 ASCII alphanumeric/hyphen characters (no_)devType: 1..12 ASCII alphanumeric/hyphen characters (no_)fileType:"I"(DL/T 860 ICD) or"J"(simplified JSON)version:"Vx.xx"(e.g."V1.00")- Example:
"AABB_ABC-1122C_J_V1.00"-> file"/data/app/model/AABB_ABC-1122C_J_V1.00.json"
Summary
Functions
Builds the TS2.2 GetModelResp / ModelChange metadata map (ModelName, ModifyTime,
FullPathFileName, FileCrc) for a model and its serialized file binary.
Returns the default TS2.1 gateway model directory "/data/app/model".
Finds a %Point{} by service_id and its DataRefer ("LDname.LNtype.LNinst.DOname")
or bare DOname.
Lists all %Point{} entries for service_id (or across all services if nil).
Returns the 5 standard TS2.1 serviceId values.
Validates a TS2.1 simplified model filename ("<model>.json") or ICD filename ("<model>.icd").
Validates a model name against TS2.1 Section 8.1:
<mfg(1..6)>_<devType(1..12)>_<I|J>_V<x.xx>.
Types
Functions
Builds the TS2.2 GetModelResp / ModelChange metadata map (ModelName, ModifyTime,
FullPathFileName, FileCrc) for a model and its serialized file binary.
@spec default_model_dir() :: String.t()
Returns the default TS2.1 gateway model directory "/data/app/model".
@spec find_point(t(), String.t(), String.t()) :: {:ok, ExCEP.Model.Point.t()} | {:error, :not_found}
Finds a %Point{} by service_id and its DataRefer ("LDname.LNtype.LNinst.DOname")
or bare DOname.
@spec list_points(t(), String.t() | nil) :: [ExCEP.Model.Point.t()]
Lists all %Point{} entries for service_id (or across all services if nil).
@spec standard_services() :: [String.t()]
Returns the 5 standard TS2.1 serviceId values.
@spec validate_filename(String.t()) :: :ok | {:error, :invalid_model_filename}
Validates a TS2.1 simplified model filename ("<model>.json") or ICD filename ("<model>.icd").
@spec validate_model_name(String.t()) :: :ok | {:error, :invalid_model_name}
Validates a model name against TS2.1 Section 8.1:
<mfg(1..6)>_<devType(1..12)>_<I|J>_V<x.xx>.