In order to record the communication between simtrace and the
mobile phone with a logic analyzer I had to configure the
pins in sniffer mode in order to attach the sniffer clips
to the SIM card slot. I did not manage to connect them to
the connector to the phone flex cable.
The compiler warning:
simtrace/usb.c:553:5: warning: initialization from incompatible pointer type [enabled by default]
&configurationDescriptorSniffer,
^
simtrace/usb.c:553:5: warning: (near initialization for 'configurationDescriptorsArr[0]') [enabled by default]
simtrace/usb.c:554:5: warning: initialization from incompatible pointer type [enabled by default]
&configurationDescriptorCCID,
^
simtrace/usb.c:554:5: warning: (near initialization for 'configurationDescriptorsArr[1]') [enabled by default]
simtrace/usb.c:555:5: warning: initialization from incompatible pointer type [enabled by default]
&configurationDescriptorPhone,
^
simtrace/usb.c:555:5: warning: (near initialization for 'configurationDescriptorsArr[2]') [enabled by default]
simtrace/usb.c:556:5: warning: initialization from incompatible pointer type [enabled by default]
&configurationDescriptorMITM,
^
simtrace/usb.c:556:5: warning: (near initialization for 'configurationDescriptorsArr[3]') [enabled by default]
simtrace/usb.c: In function 'getConfigDesc':
simtrace/usb.c:560:5: warning: return discards 'const' qualifier from pointer target type [enabled by default]
return configurationDescriptorsArr[idx];
^
simtrace/usb.c: At top level:
The variable state is not a global function.
So its value needs to be returned from each function
which might alter the state.
For now only two states exist: WAIT_RST, WAIT_CMD
FIXME: Probably there is a more elegant way to do that
The BUFLEN is fixed 5 bytes now, which has to be increased.
A timeout has to be implemented, which is smaller than max_waittime.
If the timeout is triggered, the data received in the buffer so far
should be sent to the host computer which is responsible for generating
a response. Without the timeout the max_waittime of the phone would
expire and it would repeat sending the command, so that we do not
have atomary messages anymore.