<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 17, 2018 at 1:09 AM, Levente Uzonyi <span dir="ltr"><<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br>Hi Eliot,<br>
<br>
I wonder how the Pharo builds handle those. Because these have always been enabled there.<br>
Also, these primitives are from the original SqueakVM branch (interpreter), so there should be problems as well if the primitives are missing.<br>
<br>
Levente<br>
<br>
On Fri, 16 Mar 2018, Eliot Miranda wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Levente,<br>
   no need for any action on your part.  I see that the Serial Port primitives are essentially unimplemented on Mac OS so it is trivial to provide null implementations for the "ByName" ones.<br></blockquote></blockquote><div><br></div><div>Last time I talked with the people using the SerialPort plugin they said on Mac they use the linux plugin since the Mac plugin is not implemented, the linux plugin is, and the linux plugin works on all unix systems including Mac.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On Fri, Mar 16, 2018 at 3:46 PM, Eliot Miranda <<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>> wrote:<br>
      Hi Levente,<br>
    when I try and build on Mac OS X I get this:<br>
<br>
  "_serialPortOpenByName", referenced from:<br>
      _primitiveSerialPortOpenByName in SerialPlugin.lib(SerialPlugin.<wbr>o)<br>
  "_serialPortReadIntoByName", referenced from:<br>
      _primitiveSerialPortReadByName in SerialPlugin.lib(SerialPlugin.<wbr>o)<br>
  "_serialPortWriteFromByName", referenced from:<br>
      _primitiveSerialPortWriteByNam<wbr>e in SerialPlugin.lib(SerialPlugin.<wbr>o)<br>
<br>
The implementations are missing in both platforms/Mac OS/plugins/SerialPlugin/sqMacS<wbr>erialPort.c and platforms/iOS/plugins/SerialPl<wbr>ugin/sqMacSerialPort.c.  They are there in<br>
platforms/unix/plugins/SerialP<wbr>lugin/sqUnixSerial.c and platforms/win32/plugins/Serial<wbr>Plugin/sqWin32SerialPort.c.<br>
<br>
:-(<br>
<br>
<br>
On Sat, Mar 10, 2018 at 1:58 PM, <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>> wrote:<br>
<br>
      Levente Uzonyi uploaded a new version of VMMaker to project VM Maker:<br>
      <a href="http://source.squeak.org/VMMaker/VMMaker.oscog-ul.2354.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/VMMak<wbr>er/VMMaker.oscog-ul.2354.mcz</a><br>
<br>
      ==================== Summary ====================<br>
<br>
      Name: VMMaker.oscog-ul.2354<br>
      Author: ul<br>
      Time: 10 March 2018, 10:56:45.349653 pm<br>
      UUID: b8f3192d-2b33-4a5d-83f9-785fbe<wbr>fbc570<br>
      Ancestors: VMMaker.oscog-eem.2353<br>
<br>
      Restored SerialPlugin's *byName* primitives on non-PharoVM VMs.<br>
<br>
      =============== Diff against VMMaker.oscog-eem.2353 ===============<br>
<br>
      Item was changed:<br>
        ----- Method: SerialPlugin>>primitiveSerialP<wbr>ortOpenByName:baudRate:<wbr>stopBitsType:parityType:<wbr>dataBits:inFlowControlType:out<wbr>FlowControlType:xOnByte:xOffBy<wbr>te: (in category 'primitives') -----<br>
        primitiveSerialPortOpenByName: portName baudRate: baudRate stopBitsType: stopBitsType parityType: parityType dataBits: dataBits inFlowControlType: inFlowControl outFlowControlType:<br>
      outFlowControl xOnByte: xOnChar xOffByte: xOffChar<br>
      -       <option: #PharoVM><br>
              <var: #port type: 'char *'><br>
<br>
              | port portNameSize |<br>
<br>
              self primitive: 'primitiveSerialPortOpenByName<wbr>'<br>
                      parameters: #(String SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger SmallInteger ).<br>
<br>
              portNameSize := interpreterProxy slotSizeOf: (portName asOop: String).<br>
              port := self cCode: 'calloc(portNameSize+1, sizeof(char))'.<br>
              self cCode: 'memcpy(port, portName, portNameSize)'.<br>
<br>
              self cCode: 'serialPortOpenByName(<br>
                              port, baudRate, stopBitsType, parityType, dataBits,<br>
                              inFlowControl, outFlowControl, xOnChar, xOffChar)'.<br>
<br>
              self free: port.!<br>
<br>
      Item was changed:<br>
        ----- Method: SerialPlugin>>primitiveSerialP<wbr>ortReadByName:into:startingAt:<wbr>count: (in category 'primitives') -----<br>
        primitiveSerialPortReadByName: portName into: array startingAt: startIndex count: count<br>
      -       <option: #PharoVM><br>
              <var: #port type: 'char *'><br>
<br>
              | port portNameSize bytesRead arrayPtr |<br>
<br>
              self primitive: 'primitiveSerialPortReadByName<wbr>'<br>
                      parameters: #(String  ByteArray SmallInteger SmallInteger ).<br>
<br>
              interpreterProxy success: (startIndex >= 1 and: [startIndex + count - 1 <= (interpreterProxy byteSizeOf: array cPtrAsOop)]).<br>
              "adjust for zero-origin indexing"<br>
<br>
              portNameSize := interpreterProxy slotSizeOf: (portName asOop: String).<br>
              port := self cCode: 'calloc(portNameSize+1, sizeof(char))'.<br>
              self cCode: 'memcpy(port, portName, portNameSize)'.<br>
<br>
              arrayPtr := array + startIndex - 1.<br>
              bytesRead := self cCode: 'serialPortReadIntoByName( port, count, arrayPtr)'.<br>
<br>
              self free: port.<br>
<br>
              ^ bytesRead asSmallIntegerObj!<br>
<br>
      Item was changed:<br>
        ----- Method: SerialPlugin>>primitiveSerialP<wbr>ortWriteByName:from:<wbr>startingAt:count: (in category 'primitives') -----<br>
        primitiveSerialPortWriteByName<wbr>: portName from: array startingAt: startIndex count: count<br>
      -       <option: #PharoVM><br>
              <var: #port type: 'char *'><br>
<br>
              | bytesWritten arrayPtr portNameSize port |<br>
<br>
              self primitive: 'primitiveSerialPortWriteByNam<wbr>e'<br>
                      parameters: #(String ByteArray SmallInteger SmallInteger ).<br>
<br>
              portNameSize := interpreterProxy slotSizeOf: (portName asOop: String).<br>
              port := self cCode: 'calloc(portNameSize+1, sizeof(char))'.<br>
              self cCode: 'memcpy(port, portName, portNameSize)'.<br>
<br>
              interpreterProxy success: (startIndex >= 1 and: [startIndex + count - 1 <= (interpreterProxy byteSizeOf: array cPtrAsOop)]).<br>
              interpreterProxy failed<br>
                      ifFalse: [arrayPtr := array + startIndex - 1.<br>
                              bytesWritten := self cCode: 'serialPortWriteFromByName(por<wbr>t, count, arrayPtr)' ].<br>
<br>
              self free: port.<br>
<br>
              ^ bytesWritten asSmallIntegerObj!<br>
<br>
<br>
<br>
<br>
--<br>
_,,,^..^,,,_<br>
best, Eliot<br>
<br>
<br>
<br>
<br>
--<br>
_,,,^..^,,,_<br>
best, Eliot<br>
<br>
</blockquote>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><span style="font-size:12.8px">Clément Béra<br></span><span style="color:rgb(0,0,238)"><a href="https://clementbera.github.io/" target="_blank">https://clementbera.github.io/</a></span><div style="font-size:12.8px"><a href="https://clementbera.wordpress.com/" target="_blank">https://clementbera.wordpress.com/</a></div></div></div></div></div></div>
</div></div>