lib/usbmux.js
function pack(payload_obj) {
    var payload_plist = plist.build(payload_obj)
      , payload_buf = new Buffer(payload_plist);

    var header = {
      len: payload_buf.length + 16,
      version: 1,
      request: 8,
      tag: 1
    };

    var header_buf = new Buffer(16);
    header_buf.fill(0);
    header_buf.writeUInt32LE(header.len, 0);
    header_buf.writeUInt32LE(header.version, 4);
    header_buf.writeUInt32LE(header.request, 8);
    header_buf.writeUInt32LE(header.tag, 12);

    return Buffer.concat([header_buf, payload_buf]);
  }
function pack(payload_obj) {
    var payload_plist = plist.build(payload_obj)
      , payload_buf = new Buffer(payload_plist);

    var header = {
      len: payload_buf.length + 16,
      version: 1,
      request: 8,
      tag: 1
    };

    var header_buf = new Buffer(16);
    header_buf.fill(0);
    header_buf.writeUInt32LE(header.len, 0);
    header_buf.writeUInt32LE(header.version, 4);
    header_buf.writeUInt32LE(header.request, 8);
    header_buf.writeUInt32LE(header.tag, 12);

    return Buffer.concat([header_buf, payload_buf]);
  }
function pack ( payload_obj ) { var payload_plist = plist . build ( payload_obj ) , payload_buf = new Buffer ( payload_plist ) ; var header = { len : payload_buf . length + 16 , version : 1 , request : 8 , tag : 1 } ; var header_buf = new Buffer ( 16 ) ; header_buf . fill ( 0 ) ; header_buf . writeUInt32LE ( header . len , 0 ) ; header_buf . writeUInt32LE ( header . version , 4 ) ; header_buf . writeUInt32LE ( header . request , 8 ) ; header_buf . writeUInt32LE ( header . tag , 12 ) ; return Buffer . concat ( [ header_buf , payload_buf ] ) ; }
Pack a request object into a buffer for usbmuxd

@param  {object} payload_obj
@return {Buffer}
Pack a request object into a buffer for usbmuxd