Skip to content

Commit

Permalink
Merge pull request #77 from Digital-Maritime-Consultancy/smmpFeatures
Browse files Browse the repository at this point in the history
Smmp features
  • Loading branch information
jakob22r authored Aug 9, 2024
2 parents c281bea + 6f7effb commit 2bb1619
Show file tree
Hide file tree
Showing 14 changed files with 1,071 additions and 115 deletions.
39 changes: 31 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,46 @@
</head>
<body>
<div class="container">
<div class="row">
<h1 class="ps-3">MMS Browser Agent</h1>
<hr class="hr"/>
<div class="container">
<div class="row align-items-center">
<div class="col">
<h1>MMS Browser Agent</h1>
</div>
<div class="col-auto" id="logoColumn">
</div>
<hr class="hr"/>
</div>
</div>
<div class="row">
<div class="col-10">
<h3 class="ps-3" id="mrnH3" hidden></h3>
<h3 id="mrnH3" hidden></h3>
</div>
<div class="col d-flex justify-content-end">
<button class="btn btn-danger my-2" id="disconnectBtn" hidden>Disconnect</button>
</div>
<hr class="hr"/>
</div>

<div class="row -flex align-items-start" id="smmpMenu" hidden>
<div class="col-6">
<h3>SMMP Session Establishment</h3>
<div class="form-group d-flex justify-content-between align-items-start">
<input type="text" class="form-control" id="rcClientMrn" placeholder="Remote client mrn, e.g. urn:mrn:mcp:device:mcc:core:abc">
</div>
<button type="submit" class="btn btn-primary mt-2" id="smmpConnectBtn">Connect SMMP</button>
</div>
<div class="col-6">
<h3>Active SMMP Sessions</h3>
<div id="activeSmmpSessions" hidden>
</div>
</div>
</div>
<br>
<div class="row" id="receiveContainer" hidden>
<h3>Received messages</h3>
<div class="container h-100">
<div class="form-control overflow-auto" id="incomingArea" style="height: 200px"></div>
<button class="btn btn-primary my-2 item" id="receiveBtn">Receive Messages</button>
<button class="btn btn-secondary my-2 item" id="downloadReceived" hidden>Download</button>
</div>
<hr class="hr"/>
</div>
Expand Down Expand Up @@ -59,15 +81,16 @@ <h3>Send message</h3>
<textarea class="form-control my-2" id="msgArea" cols="50" rows="2"></textarea>
</div>
<div class="row">
<label for="msgArea" class="form-label">Select File Here (less than 1MB)</label>
<label for="msgArea" class="form-label">Select File Here</label>
<input type="file" id="fileInput">
<div class="container">
<div id="file-state-loaded" class="bg-success text-white py-2 px-3 mb-3">File loaded</div>
<div id="file-state-unloaded" class="bg-secondary text-white py-2 px-3">File not chosen</div>
</div>
</div>
<div class="row">
<button class="btn btn-primary my-2" id="sendBtn">Send</button>
<button class="btn btn-primary mx-2 my-2" id="sendBtn">Send</button>
<button class="btn btn-warning mx-2 my-2" id="sendSmmpBtn" hidden>Send SMMP</button>
</div>
</div>
<hr class="hr"/>
Expand Down Expand Up @@ -116,4 +139,4 @@ <h3>Connect to MMS network</h3>
</div>

</body>
</html>
</html>
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"style-loader": "^4.0.0",
"ts-loader": "^9.4.4",
"typescript": "^5.5.4",
"url-loader": "^4.1.1",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.2",
Expand All @@ -34,10 +35,13 @@
"asn1js": "^3.0.5",
"bigint-conversion": "^2.4.3",
"bootstrap": "^5.3.2",
"buffer": "^6.0.3",
"jquery": "^3.7.1",
"long": "^5.2.3",
"path-browserify": "^1.0.1",
"pkijs": "^3.2.4",
"protobufjs": "^7.2.6",
"stream-browserify": "^3.0.0",
"uuid": "^10.0.0"
}
}
81 changes: 81 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 19 additions & 16 deletions smmp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import Long = require("long");
/** Properties of a SmmpHeader. */
export interface ISmmpHeader {

/** SmmpHeader magic */
magic?: (number|null);

/** SmmpHeader control */
control?: (Uint8Array|null);

Expand All @@ -20,6 +17,9 @@ export interface ISmmpHeader {

/** SmmpHeader uuid */
uuid?: (string|null);

/** SmmpHeader curves */
curves?: (Curve[]|null);
}

/** Represents a SmmpHeader. */
Expand All @@ -31,24 +31,30 @@ export class SmmpHeader implements ISmmpHeader {
*/
constructor(properties?: ISmmpHeader);

/** SmmpHeader magic. */
public magic: number;

/** SmmpHeader control. */
public control: Uint8Array;

/** SmmpHeader payloadLen. */
public payloadLen: number;

/** SmmpHeader blockNum. */
public blockNum: number;
public blockNum?: (number|null);

/** SmmpHeader totalBlocks. */
public totalBlocks: number;
public totalBlocks?: (number|null);

/** SmmpHeader uuid. */
public uuid: string;

/** SmmpHeader curves. */
public curves: Curve[];

/** SmmpHeader _blockNum. */
public _blockNum?: "blockNum";

/** SmmpHeader _totalBlocks. */
public _totalBlocks?: "totalBlocks";

/**
* Creates a new SmmpHeader instance using the specified properties.
* @param [properties] Properties to set
Expand Down Expand Up @@ -127,14 +133,11 @@ export class SmmpHeader implements ISmmpHeader {
public static getTypeUrl(typeUrlPrefix?: string): string;
}

/** Properties of a SmmpMessage. */
export interface ISmmpMessage {

/** SmmpMessage header */
header?: (ISmmpHeader|null);

/** SmmpMessage data */
data?: (Uint8Array|null);
/** Curve enum. */
export enum Curve {
unspecified = 0,
secp256r1 = 1,
secp384r1 = 2
}

/** Represents a SmmpMessage. */
Expand Down
Loading

0 comments on commit 2bb1619

Please sign in to comment.