Change to JSDoc type formatting {type}
This commit is contained in:
+28
-28
@@ -5,10 +5,10 @@ var log = require('winston'),
|
||||
bundleMsgId = 0;
|
||||
|
||||
/**
|
||||
* Calcualte cmdLength from object
|
||||
* Calculate cmdLength from object
|
||||
*
|
||||
* @param obj obj
|
||||
* @param func callback(err, cmdLength)
|
||||
* @param {object} obj
|
||||
* @param {function} callback(err, cmdLength)
|
||||
*/
|
||||
function calcCmdLength(obj, callback) {
|
||||
var cmdLength = 16, // All commands are at least 16 octets long
|
||||
@@ -65,9 +65,9 @@ function calcCmdLength(obj, callback) {
|
||||
/**
|
||||
* Write PDU to buffer
|
||||
*
|
||||
* @param obj obj - the PDU object to be written to buffer
|
||||
* @param int cmdLength - The length of the pdu buffer
|
||||
* @param func callback(err, buff)
|
||||
* @param {object} obj - the PDU object to be written to buffer
|
||||
* @param {number} cmdLength - The length of the pdu buffer
|
||||
* @param {function} callback(err, buff)
|
||||
*/
|
||||
function writeBuffer(obj, cmdLength, callback) {
|
||||
var offset = 16, // Start the offset on the body
|
||||
@@ -162,10 +162,10 @@ function writeBuffer(obj, cmdLength, callback) {
|
||||
/**
|
||||
* Decode a short_message
|
||||
*
|
||||
* @param buf buffer
|
||||
* @param str encoding 'ASCII', 'LATIN1' or 'UCS2' or hex values
|
||||
* @param int offset - defaults to 0
|
||||
* @return str in utf8 format
|
||||
* @param {buffer} buffer
|
||||
* @param {string} encoding 'ASCII', 'LATIN1' or 'UCS2' or hex values
|
||||
* @param {number} offset - defaults to 0
|
||||
* @return {string} in utf8 format
|
||||
*/
|
||||
function decodeMsg(buffer, encoding, offset) {
|
||||
var checkEnc;
|
||||
@@ -199,9 +199,9 @@ function encodeMsg(str) {
|
||||
/**
|
||||
* Transforms a PDU to an object
|
||||
*
|
||||
* @param buf pdu
|
||||
* @param bol stupidNullByte - Define if the short_message should be followed by a stupid NULL byte - will be auto resolved if left undefined
|
||||
* @param func callback(err, obj)
|
||||
* @param {buffer} pdu
|
||||
* @param {boolean} stupidNullByte - Define if the short_message should be followed by a stupid NULL byte - will be auto resolved if left undefined
|
||||
* @param {function} callback(err, obj)
|
||||
*/
|
||||
function pduToObj(pdu, stupidNullByte, callback) {
|
||||
var retObj = {'params': {}, 'tlvs': {}},
|
||||
@@ -359,8 +359,8 @@ function pduToObj(pdu, stupidNullByte, callback) {
|
||||
/**
|
||||
* Transform an object to a PDU
|
||||
*
|
||||
* @param obj obj - example {'cmdName': 'bind_transceiver_resp', 'cmdStatus': 'ESME_ROK', 'seqNr': 2} - to add parameters add a key 'params' as object
|
||||
* @param func callback(err, pdu)
|
||||
* @param {object} obj - example {'cmdName': 'bind_transceiver_resp', 'cmdStatus': 'ESME_ROK', 'seqNr': 2} - to add parameters add a key 'params' as object
|
||||
* @param {function} callback(err, pdu)
|
||||
*/
|
||||
function objToPdu(obj, callback) {
|
||||
var err = null,
|
||||
@@ -438,11 +438,11 @@ function objToPdu(obj, callback) {
|
||||
/**
|
||||
* Create a PDU as a return to another PDU
|
||||
*
|
||||
* @param obj or buf pdu
|
||||
* @param str status - see list at defs.errors - defaults to 'ESME_ROK' - no error (OPTIONAL)
|
||||
* @param obj params (OPTIONAL)
|
||||
* @param obj tlvs (OPTIONAL)
|
||||
* @param func callback(err, pduBuffer) (OPTIONAL)
|
||||
* @param {object|buffer} pdu
|
||||
* @param {string} status - see list at defs.errors - defaults to 'ESME_ROK' - no error (OPTIONAL)
|
||||
* @param {object} [params]
|
||||
* @param {object} [tlvs]
|
||||
* @param {function} [callback(err, pduBuffer)]
|
||||
*/
|
||||
function pduReturn(pdu, status, params, tlvs, callback) {
|
||||
var err = null,
|
||||
@@ -544,8 +544,8 @@ function pduReturn(pdu, status, params, tlvs, callback) {
|
||||
/**
|
||||
* Format a js date object as ugly SMPP date format
|
||||
*
|
||||
* @param obj jsDateObj
|
||||
* @return str
|
||||
* @param {object} jsDateObj
|
||||
* @return {string}
|
||||
*/
|
||||
function smppDate(jsDateObj) {
|
||||
var uglyStr = '';
|
||||
@@ -582,8 +582,8 @@ function smppDate(jsDateObj) {
|
||||
/**
|
||||
* Calculate bitCount of short_message
|
||||
*
|
||||
* @param str msg
|
||||
* @param str encoding - Force encoding ASCII or UCS2 (OPTIONAL)
|
||||
* @param {string} msg
|
||||
* @param {string} encoding - Force encoding ASCII or UCS2 (OPTIONAL)
|
||||
* @return integer
|
||||
*/
|
||||
function bitCount(msg, encoding) {
|
||||
@@ -601,8 +601,8 @@ function bitCount(msg, encoding) {
|
||||
/**
|
||||
* Split a message into multiple messages
|
||||
*
|
||||
* @param str msg
|
||||
* @param str encoding - Force encoding ASCII or UCS2 (OPTIONAL)
|
||||
* @param {string} msg
|
||||
* @param {string} encoding - Force encoding ASCII or UCS2 (OPTIONAL)
|
||||
* @return array of buffers
|
||||
*/
|
||||
function splitMsg(msg, encoding) {
|
||||
@@ -691,8 +691,8 @@ function splitMsg(msg, encoding) {
|
||||
* Send a dlr to an sms
|
||||
* This must be called from an sms object context
|
||||
*
|
||||
* @param str status - see list at defs.consts.MESSAGE_STATE - defaults to 'DELIVERED'
|
||||
* @param func callback(err, retPdu, dlrPduObj)
|
||||
* @param {string} status - see list at defs.consts.MESSAGE_STATE - defaults to 'DELIVERED'
|
||||
* @param {function} callback(err, retPdu, dlrPduObj)
|
||||
*/
|
||||
function smsDlr(status, callback) {
|
||||
var shortMessage,
|
||||
|
||||
Reference in New Issue
Block a user