| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
sap-dummy is a SAP server backend so its init function is called for
each adapter registered and not only on start. Without this patch
sap-dummy interface was only registered for first adapter.
|
|
|
|
|
|
|
|
| |
Remove static pointer used to keep track of registered server and
just pass allocated server as user data to io and DBus callbacks.
It is up to backend now if multiple adapters are supported or if
multiple connections are possible (one per adapter or one in total).
|
|
|
|
|
|
| |
NULL conn member of server structure passed to function instead of
static variable. This is to properly support multiple adapters.
Also rename sap_conn_remove to sap_server_remove_conn.
|
|
|
|
|
|
|
| |
This is a preparation for fixing SAP server when multiple adapters are
present. This is to avoid having extra pointer from sap_connection to
its sap_server struture. Only one connection per server is allowed
anyway so using sap_server as key is safe.
|
|
|
|
|
|
|
|
| |
This error message is used to reply to SAP protocol errors and it
should not be used by drivers as they don't have access to server
internal state machine. Messages passed to drivers are valid and
properly formatted so drivers shall use result code in response
messages to indicate error (section 4.11 of SAP specification).
|
|
|
|
| |
This is to avoid shadowing by local functions variables.
|
|
|
|
| |
Use struct sap_connection as parameter type for clarity.
|
|
|
|
|
| |
conn->io should be set to NULl after unref to avoid calling shutdown
and unref twice.
|
|
|
|
|
| |
Both conn and buff are always passed as valid pointers. No need to
double check them.
|
|
|
|
|
|
|
| |
Some SAP operations (eg. APDU transfer) occurs very often even with
simple scenarios like subscribing to GSM network. This results in flood
of log messages. Since those messages are mostly usefull only when
developing SAP backend hide them after SAP_DEBUG flag.
|
|
|
|
|
|
|
|
|
|
|
| |
According to SAP 1.1 specification MaxMsgSize parameter of CONNECT_RESP
is conditional and should not be added for every status code. Add this
parameter only if status code is "Error, Server does not support
message size" (see section 4.1.1 of SAP specification).
To avoid confusion maxmsgsize param is removed from sap_connect_rsp and
it is assumed that SAP driver is able to handle messages with size up
to SAP_BUF_SIZE bytes.
|
|
|
|
|
| |
SAP_DISCONNECTION_TYPE_CLIENT is an implementation detail and is not
specified by SAP profile specification.
|
|
|
|
|
| |
It makes it easier to understand what actions are performed in each
server state.
|
|
|
|
| |
This improves readiblity of what actions are performed on each state.
|
| |
|
|
|
|
|
|
| |
disconnect_ind is an helper funtion and is always called with valid
connection and from valid state so there is no need to double check
that.
|
|
|
|
|
| |
If DBus interface registration failed dbus connection should be
unreferenced.
|
| |
|
|
|
|
|
| |
src is only used in sap_server_register, no need to keep in memory for
SAP session duration.
|
| |
|
| |
|
|
|
|
| |
This makes function easier to read and more similar to rest of code.
|
|
|
|
| |
This improves readbility of whan new ongoing call status is being set.
|
| |
|
|
|
|
| |
Buffer passed to check_msg() is always valid.
|
|
|
|
|
| |
Use GDBUS_* macros, so signature and reply fields are not set in each
method/signal.
|
|
|
|
|
| |
With these macro helpers we can separate in/out arguments and use their
own vector.
|
|
|
|
|
|
|
| |
Constify signal tables with the following command:
find . -name '*.[ch]' -exec \
sed -i 's/\(GDBusSignalTable .* =\)/const \1/g' {} \;
|
|
|
|
|
|
|
| |
Constify method tables with the following command:
find . -name '*.[ch]' -exec \
sed -i 's/\(GDBusMethodTable .* =\)/const \1/g' {} \;
|
| |
|
|
|
|
| |
Dummy interface is registered on plugin init and is never unregistered
|
| |
|
|
|
|
| |
Correct spelling is "incoming" not "incomming".
|
|
|
|
|
| |
Bitwise operations are done before arithmetic operations and this might
cause undesired results if macro is called with parameter of form x+y.
|
|
|
|
|
|
| |
Variables which are assigned to the errno variable (usually called
"err") should be negative, and "-err" should be used where a positive
value is needed.
|
|
|
|
|
|
|
|
| |
There is no need to send sap_connect_rsp when "call" is ended. Status
Indication is enough.
Also we should provide max supported msg size in the connect response
having status: OK_ONGOING_CALL.
|
|
|
|
|
|
|
|
|
|
| |
If device is in ongoing call SAP server shall response on connect with
connection status 0x04 and once call is ended shall send reset status
indication.
With this patch, when reset status indication comes from backend and SAP
server is in connection in progreess state, SAP server changes state to
connected.
|
|
|
|
|
|
| |
Max Message size shall be added to connect response when
ConnectionStatus is SAP_STATUS_OK_ONGOING_CALL. Let's always attach
maxmsgsize to the connect response if it is provided by the backend.
|
|
|
|
|
| |
With this patch support for handling connect request during ongoing call
is added.
|
|
|
|
|
|
|
| |
Without this patch, when dropping RFCOMM channel to sap server, the
component's channel cleanup process doesn't release assigned GIOChannel
resources since conn->io is set to NULL before calling sap_conn_remove
(which would normally do the g_io_channel_unref).
|
| |
|
|
|
|
| |
With this patch it is not possible to have incorrect padding equal to 4.
|
|
|
|
| |
It is already defined in sap/sap.h which is included by sap/server.c.
|
|
|
|
| |
This is a leftover from sap code upstreaming process.
|
| |
|
| |
|
|
|
|
|
| |
send_message returns the number of sent bytes and -EIO in case of
IO error now
|
| |
|
|
|
|
|
|
|
|
| |
The sap_disconnect_ind() let's the sim driver to indicate
immediate disconnection.
Add support of immediate disconnection in sap-dummy driver
as well as a card status change in order to pass all PTS tests.
|