就是GSM AT指令中pdu 数据格式的转换问题。

解决方案 »

  1.   

    左移的实现:
        '前提是intSource*2不超过Integer能表示的最大值
        Dim intSource, intDest As Integer
        
        intSource = 211
        intDest = (intSource * 2) And 255    Me.Text1.Text = intDest右移的实现:
        Dim intSource, intDest As Integer
        
        intSource = 211
        
        If (intSource \ 2) * 2 <> intSource Then
            intSource = intSource - 1
        End If
        
        intDest = (intSource / 2)若为循环左移则首先判断最高位是否为1,即(x and 128)是否等于1,若不等于1则同左移处理,等于1时左移完成后将1补到最低位,即(x or 1)。若为循环右移则首先判断最低位是否为1,即(x and 1)是否等于1,若不等于1则同右移处理,等于1时右移完成后将1补到最高位,即(x or 128)。