VE Lua Documentation

Press F to search!

encodeBinWorkBuffer

Definition


-- @/lua/common/lpack.lua:112

local function encodeBinWorkBuffer(v)
  if v == nil then return '' end
  bufTmp:reset():put('b')
  peekEncBin[type(v)](bufTmp, v)
  return bufTmp
end

Callers

@/lua/ge/extensions/tech/platoonFunctions.lua
        local vehicle = tostring(vehicleID)
        be:sendToMailbox(tostring(vehicle), lpack.encodeBinWorkBuffer(i))
        return i  -- Return the index of the vehicle in the platoon
  local mailBoxNameVehicleInfront = "vehicleInfront"..vid
  be:sendToMailbox(mailBoxNameVehicleInfront, lpack.encodeBinWorkBuffer(vehicleInfront))
              getRelayVehiclesID(leaderID, i)
              be:sendToMailbox(vehicle, lpack.encodeBinWorkBuffer(i))
            end
  local ultrasonicID = extensions.tech_sensors.createUltrasonic(vid,ultrasonicArgs)
  be:sendToMailbox(mailBoxName, lpack.encodeBinWorkBuffer(leaderID))
  print("vehicle: "..vid.." ultrasonicID: "..ultrasonicID)
  local mailboxNameUltrasonic = vid.."UltrasonicReading"
  be:sendToMailbox(mailBoxName, lpack.encodeBinWorkBuffer(leaderID))
  printPlatoons()
      print(type(vehicle))
      be:sendToMailbox(vehicle, lpack.encodeBinWorkBuffer(i))
      local launchFunctonCall = "extensions.tech_platooning.updateLeaderToFollow("..newLeaderID..")" --changing the leader to follow for the rest of the vehicles in the platoon
      be:queueObjectLua(v, launchFunctonCall)
      be:sendToMailbox(mailBoxName, lpack.encodeBinWorkBuffer(newLeaderID))
    end
  local mailboxNameUltrasonic = externalVehicleID.."UltrasonicReading"
  be:sendToMailbox(mailBoxName, lpack.encodeBinWorkBuffer(leaderID))
  local ACCFunctionCall = "extensions.tech_platooning.joinPlatoon("..leaderID..","..externalVehicleID..","..speed..")"
          if distance <= 8 then
            be:sendToMailbox(mailboxNameUltrasonic, lpack.encodeBinWorkBuffer(distance))
          end
@/lua/ge/map.lua
  --log('D', 'map', "generating roads took " .. string.format("%2.3f ms", timer:stopAndReset()))
  be:sendToMailbox("mapData", lpack.encodeBinWorkBuffer(
    {

  be:sendToMailbox("updateDrivabilities", lpack.encodeBinWorkBuffer(nil)) -- clear updateDrivabilities mailbox
  if dtSim > 0 then
    be:sendToMailbox("objUpdate", lpack.encodeBinWorkBuffer(M.objects))
    if objectsCount == 0 then
  if hasChanged then -- send data if there is at least one change
    be:sendToMailbox("updateDrivabilities", lpack.encodeBinWorkBuffer(changeSet)) -- mailbox is cleared when map is loaded
    for objId, _ in pairs(M.objects) do