#include "net_nfc_client_hce.h"
-#endif //__NET_NFC_H__
+#endif /* __NET_NFC_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_H__
+#endif /* __NET_NFC_CLIENT_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_CONTEXT_H__
+#endif /* __NET_NFC_CLIENT_CONTEXT_H__ */
extern "C" {
#endif
-typedef enum
-{
+typedef enum {
NET_NFC_HANDOVER_START,
NET_NFC_HANDOVER_FINISH,
}
}
#endif
-#endif //__NET_NFC_CLIENT_HANDOVER_H__
+#endif /* __NET_NFC_CLIENT_HANDOVER_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_HCE_H__
+#endif /* __NET_NFC_CLIENT_HCE_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_HCE_IPC_H__
+#endif /* __NET_NFC_CLIENT_HCE_IPC_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_LLCP_H__
+#endif /* __NET_NFC_CLIENT_LLCP_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_MANAGER_H__
+#endif /* __NET_NFC_CLIENT_MANAGER_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_NDEF_H__
+#endif /* __NET_NFC_CLIENT_NDEF_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_P2P_H__
+#endif /* __NET_NFC_CLIENT_P2P_H__ */
net_nfc_error_e net_nfc_client_se_set_preferred_handler_sync(bool state);
-//net_nfc_error_e net_nfc_client_hce_get_route_table_sync(data_h arg_aid);
+/*net_nfc_error_e net_nfc_client_hce_get_route_table_sync(data_h arg_aid);*/
/* TODO : move to internal header */
}
#endif
-#endif //__NET_NFC_CLIENT_SE_H__
+#endif /* __NET_NFC_CLIENT_SE_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_SNEP_H__
+#endif /* __NET_NFC_CLIENT_SNEP_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_SYSTEM_HANDLER_H__
+#endif /* __NET_NFC_CLIENT_SYSTEM_HANDLER_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_TAG_H__
+#endif /* __NET_NFC_CLIENT_TAG_H__ */
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] req_code request code with this command
- @param[in] time_slot time slot value
+ @param[in] handle target handle of detected tag
+ @param[in] req_code request code with this command
+ @param[in] time_slot time slot value
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] number_of_area_service the number of specified Area / Service list
- @param[in] area_service_list specified Area / Service list
+ @param[in] handle target handle of detected tag
+ @param[in] number_of_area_service the number of specified Area / Service list
+ @param[in] area_service_list specified Area / Service list
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
+ @param[in] handle target handle of detected tag
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] number_of_service the number of service list to read
- @param[in] service_list specified Service list to read
- @param[in] number_of_blocks the number of blocks to read
- @param[in] block_list the blocks to read
+ @param[in] handle target handle of detected tag
+ @param[in] number_of_service the number of service list to read
+ @param[in] service_list specified Service list to read
+ @param[in] number_of_blocks the number of blocks to read
+ @param[in] block_list the blocks to read
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] number_of_service the number of service list to write
- @param[in] service_list specified Service list to write
- @param[in] number_of_blocks the number of blocks to write
- @param[in] block_list the blocks to write
- @param[in] data the data to write
+ @param[in] handle target handle of detected tag
+ @param[in] number_of_service the number of service list to write
+ @param[in] service_list specified Service list to write
+ @param[in] number_of_blocks the number of blocks to write
+ @param[in] block_list the blocks to write
+ @param[in] data the data to write
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
+ @param[in] handle target handle of detected tag
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
#endif
-#endif //__NET_NFC_CLIENT_TAG_FELICA_H__
+#endif /* __NET_NFC_CLIENT_TAG_FELICA_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_TAG_INTERNAL_H__
+#endif /* __NET_NFC_CLIENT_TAG_INTERNAL_H__ */
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
+ @param[in] handle target handle of detected tag
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] block block number. (block 0 ~ block E)
- @param[in] byte byte number. Each block has 8 bytes. (byte 0 ~ byte 7)
+ @param[in] handle target handle of detected tag
+ @param[in] block block number. (block 0 ~ block E)
+ @param[in] byte byte number. Each block has 8 bytes. (byte 0 ~ byte 7)
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
+ @param[in] handle target handle of detected tag
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] block block number. (block 0 ~ block E)
- @param[in] data the data to write
- @param[in] byte byte number. Each block has 8 bytes. (byte 0 ~ byte 7)
+ @param[in] handle target handle of detected tag
+ @param[in] block block number. (block 0 ~ block E)
+ @param[in] data the data to write
+ @param[in] byte byte number. Each block has 8 bytes. (byte 0 ~ byte 7)
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] block block number. (block 0 ~ block E)
- @param[in] data the data to write
- @param[in] byte byte number. Each block has 8 bytes. (byte 0 ~ byte 7)
+ @param[in] handle target handle of detected tag
+ @param[in] block block number. (block 0 ~ block E)
+ @param[in] data the data to write
+ @param[in] byte byte number. Each block has 8 bytes. (byte 0 ~ byte 7)
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the internal oal error
#endif
-#endif //__NET_NFC_CLIENT_TAG_JEWEL_H__
+#endif /* __NET_NFC_CLIENT_TAG_JEWEL_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_TEST_H__
+#endif /* __NET_NFC_CLIENT_TEST_H__ */
}
#endif
-#endif //__NET_NFC_CLIENT_TRANSCEIVE_H__
+#endif /* __NET_NFC_CLIENT_TRANSCEIVE_H__ */
extern "C" {
#endif
-typedef struct _NetNfcCallback
-{
+typedef struct _NetNfcCallback {
void *callback;
void *user_data;
}
}
#endif
-#endif //__NET_NFC_CLIENT_UTIL_INTERNAL_H__
+#endif /* __NET_NFC_CLIENT_UTIL_INTERNAL_H__ */
@{
This document is for the APIs reference document
- NFC Manager defines are defined in <nfc-manager-def.h>
+ NFC Manager defines are defined in <nfc-manager-def.h>
- @li @c #net_nfc_initialize Initialize the nfc device.
+ @li @c #net_nfc_initialize Initialize the nfc device.
*/
/**
create data handler only.
- @param[out] data data handler
+ @param[out] data data handler
- @return return the result of this operation
+ @return return the result of this operation
@exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
@exception NET_NFC_ALLOC_FAIL memory allocation is failed
/**
create data handler with initial values, bytes will be copied into the data handler.
- @param[out] data data handler
- @param[in] bytes binary data
+ @param[out] data data handler
+ @param[in] bytes binary data
@param[in] length size of binary data;
- @return return the result of this operation
+ @return return the result of this operation
@exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
@exception NET_NFC_ALLOC_FAIL memory allocation is failed
get the byes and length from data handler. data handler assume bytes may have '0x0' value.
that's why this function also provides the length.
- @param[in] data data handler
+ @param[in] data data handler
@param[out] bytes binary pointer (it returns the direct pointer of handler's data) do not free this
@param[out] length length of the binary data;
- @return return the result of this operation
+ @return return the result of this operation
@exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
replace the data handler with given bytes. binary data (bytes) will be copied to data hander.
application should free or use local variable for given byte pointer.
- @param[in] data data handler
- @param[in] bytes binary data
+ @param[in] data data handler
+ @param[in] bytes binary data
@param[in] length size of binary data
- @return return the result of this operation
+ @return return the result of this operation
@exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
/**
get length of data handler's bytes.
- @param[in] data data handler
+ @param[in] data data handler
- @return return the length of bytes
+ @return return the length of bytes
- @exception 0 is returned if data is NULL
+ @exception 0 is returned if data is NULL
*/
size_t net_nfc_get_data_length(const data_h data);
/**
get pointer of the handler's bytes (do not free this. it should be freed when the application call "net_nfc_free_data" function)
- @param[in] data data handler
+ @param[in] data data handler
- @return return the pointer of bytes.
+ @return return the pointer of bytes.
- @exception NULL is returned if data is NULL
+ @exception NULL is returned if data is NULL
*/
uint8_t *net_nfc_get_data_buffer(const data_h data);
/**
free data handler. (it also free the copied bytes)
- @param[in] data data handler
+ @param[in] data data handler
- @return return the result of this operation
+ @return return the result of this operation
@exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
}
#endif
-#endif //__NET_NFC_DATA_H__
+#endif /* __NET_NFC_DATA_H__ */
@{
This document is for the APIs reference document
- NFC Manager defines are defined in <nfc-manager-def.h>
+ NFC Manager defines are defined in <nfc-manager-def.h>
- @li @c #net_nfc_initialize Initialize the nfc device.
+ @li @c #net_nfc_initialize Initialize the nfc device.
*/
@param[out] ndef_message instance of the ndef_message is retuened
- @return return the result of the calling the function
+ @return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illigal NULL pointer(s)
@exception NET_NFC_ALLOC_FAIL memory allocation is failed
\par Sync (or) Async: sync
This is a Synchronous API
- @param[in] ndef_message output structure to get the record
- @param[out] count number of record count
+ @param[in] ndef_message output structure to get the record
+ @param[out] count number of record count
@return return the result of the calling the function
\par Sync (or) Async: sync
This is a Synchronous API
- @param[in] ndef_message output structure to get the record
- @param[out] rawdata this is the raw data that will be formed into the
+ @param[in] ndef_message output structure to get the record
+ @param[out] rawdata this is the raw data that will be formed into the
@return return the result of the calling the function
This is a Synchronous API
@param[out] ndef_message ndef message handler that will be returned
- @param[in] rawdata ndef message that formed in bytes array
+ @param[in] rawdata ndef message that formed in bytes array
@return return the result of the calling the function
This is a Synchronous API
@param[in] ndef_message NDEF message structure
- @param[in] record a record will be added into the ndef message
+ @param[in] record a record will be added into the ndef message
@return return the result of the calling the function
\par Sync (or) Async: sync
This is a Synchronous API
- @param[in] ndef_message the message wil be freed
- @param[in] index index of record
+ @param[in] ndef_message the message wil be freed
+ @param[in] index index of record
- @return return the result of the calling the function
+ @return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illigal NULL pointer(s)
@exception NET_NFC_OUT_OF_BOUND index is out of bound
}
#endif
-#endif //__NET_NFC_NDEF_MESSAGE_H__
+#endif /* __NET_NFC_NDEF_MESSAGE_H__ */
/**
This function create carrier configure handler instance.
- @param[out] config instance handler
- @param[in] type Carrier types. It would be BT or WPS or etc.
+ @param[out] config instance handler
+ @param[in] type Carrier types. It would be BT or WPS or etc.
@return return the result of the calling the function
/**
free the configure handle
- @param[in] config instance handler
+ @param[in] config instance handler
@return return the result of the calling the function
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
- @exception NET_NFC_NO_DATA_FOUND the attribute does not exist in the group
+ @exception NET_NFC_NO_DATA_FOUND the attribute does not exist in the group
*/
net_nfc_error_e net_nfc_get_carrier_config_group_property(net_nfc_property_group_h group, uint16_t attribute, uint16_t *size, uint8_t **data);
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
- @exception NET_NFC_NO_DATA_FOUND the attribute does not exist in the group
+ @exception NET_NFC_NO_DATA_FOUND the attribute does not exist in the group
*/
net_nfc_error_e net_nfc_remove_carrier_config_group_property(net_nfc_property_group_h group, uint16_t attribute);
#endif
-#endif //__NET_NFC_NDEF_MESSAGE_HANDOVER_H__
+#endif /* __NET_NFC_NDEF_MESSAGE_HANDOVER_H__ */
@{
This document is for the APIs reference document
- NFC Manager defines are defined in <nfc-typedef.h>
+ NFC Manager defines are defined in <nfc-typedef.h>
*/
/**
This define gives you Message Begin from the flag byte
- @param[in] flag flag that comes from "net_nfc_get_record_flags" function
- @return the mb flag
+ @param[in] flag flag that comes from "net_nfc_get_record_flags" function
+ @return the mb flag
@exception NONE
*/
/**
This define gives you Message end from the flag byte
- @param[in] flag flag that comes from "net_nfc_get_record_flags" function
- @return the me flag
+ @param[in] flag flag that comes from "net_nfc_get_record_flags" function
+ @return the me flag
@exception NONE
*/
/**
This define gives you Chun Flag that indicate that either the first record chunk or a middle record chunk of a chunked payload
- @param[in] flag flag that comes from "net_nfc_get_record_flags" function
- @return the chunk flag
+ @param[in] flag flag that comes from "net_nfc_get_record_flags" function
+ @return the chunk flag
@exception NONE
*/
/**
This define gives you ID length present flag
- @param[in] flag flag that comes from "net_nfc_get_record_flags" function
- @return the il (id length flag) flag
+ @param[in] flag flag that comes from "net_nfc_get_record_flags" function
+ @return the il (id length flag) flag
@exception NONE
This define gives you short record flag. This flag indicates that the payload length filed is a single octet
@param[in] flag flag that comes from "net_nfc_get_record_flags" function
- @return the short record flag
+ @return the short record flag
@exception NONE
*/
@param[out] record Record handler
@param[in] tnf record type (TNF value) empty, well known, mime type, URI, external, or unchanged
- @param[in] typeName specify type name ex) Sp, U, or Hr ...
- @param[in] id record id
- @param[in] payload payload of this record
+ @param[in] typeName specify type name ex) Sp, U, or Hr ...
+ @param[in] id record id
+ @param[in] payload payload of this record
@return return the result of the calling the function
this function gives you the pointer of pyaload that is contained by record.
Do not free the payload. it will be freed when the record is freed
- @param[in] record Record handler
- @param[out] payload data_h type payload pointer (it gives you the pointer of payload; not copied)
+ @param[in] record Record handler
+ @param[out] payload data_h type payload pointer (it gives you the pointer of payload; not copied)
@return return the result of the calling the function
this function gives you the pointer of record type that is contained by record.
Do not free the type. it will be freed when the record is freed
- @param[in] record Record handler
- @param[out] type dat_h type pointer (it gives you the pointer of type; not copied)
+ @param[in] record Record handler
+ @param[out] type dat_h type pointer (it gives you the pointer of type; not copied)
@return return the result of the calling the function
it may return NULL pointer if the ID is not exist
Do not free the type. it will be freed when the record is freed.
- @param[in] record Record handler
- @param[out] id dat_h type ID pointer (it gives you the pointer of payload not copied)
+ @param[in] record Record handler
+ @param[out] id dat_h type ID pointer (it gives you the pointer of payload not copied)
@return return the result of the calling the function
/**
this function is getter of record TNF value.
- @param[in] record Record handler
- @param[out] tnf TNF value
+ @param[in] record Record handler
+ @param[out] tnf TNF value
@return return the result of the calling the function
this function is getter of record flags.
you can get the each flag value by using defines "RECORD_GET_XX"
- @param[in] record Record handler
- @param[out] flag flag value (it gives you the pointer of payload not copied)
+ @param[in] record Record handler
+ @param[out] flag flag value (it gives you the pointer of payload not copied)
@return return the result of the calling the function
/**
you can set record ID with this function
- @param[in] record Record handler
+ @param[in] record Record handler
@param[in] id Record ID
@return return the result of the calling the function
/**
this function free the record handler. do not use this function after appending the ndef message
- @param[in] record Record handler
+ @param[in] record Record handler
@return return the result of the calling the function
/**
this function get text from text record. it allocate buffer char and store the text string. you should free this string.
- @param[in] record Record handler
- @param[out] buffer text string
+ @param[in] record Record handler
+ @param[out] buffer text string
@return return the result of the calling the function
/**
this function get language code from text record. (ex: US-en)
- @param[in] record Record handler
- @param[out] lang_code_str lang code string value followed by IANA
+ @param[in] record Record handler
+ @param[out] lang_code_str lang code string value followed by IANA
@return return the result of the calling the function
/**
this function get encoding type from text record (ex: UTF-8)
- @param[in] record Record handler
- @param[out] encoding encoding type
+ @param[in] record Record handler
+ @param[out] encoding encoding type
@return return the result of the calling the function
/**
this function get URI from uri record. you should free the uri string.
- @param[in] record Record handler
- @param[out] uri uri text string
+ @param[in] record Record handler
+ @param[out] uri uri text string
@return return the result of the calling the function
#endif
-#endif //__NET_NFC_NDEF_RECORD_H__
+#endif /* __NET_NFC_NDEF_RECORD_H__ */
@{
This document is for the APIs reference document
- NFC Manager defines are defined in <nfc-typedef.h>
+ NFC Manager defines are defined in <nfc-typedef.h>
*/
#endif
-#endif //__NET_NFC_SIGN_RECORD_H__
+#endif /* __NET_NFC_SIGN_RECORD_H__ */
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] sector sector to authenticate with key A
- @param[in] auth_key 6 byte key to authenticate the sector
+ @param[in] handle target handle of detected tag
+ @param[in] sector sector to authenticate with key A
+ @param[in] auth_key 6 byte key to authenticate the sector
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] sector sector to authenticate with key B
- @param[in] auth_key 6 byte key to authenticate the sector
+ @param[in] handle target handle of detected tag
+ @param[in] sector sector to authenticate with key B
+ @param[in] auth_key 6 byte key to authenticate the sector
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] addr block or starting page number
+ @param[in] handle target handle of detected tag
+ @param[in] addr block or starting page number
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] addr block or starting page number
- @param[in] data data to write
+ @param[in] handle target handle of detected tag
+ @param[in] addr block or starting page number
+ @param[in] data data to write
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] addr block or starting page number
- @param[in] data data to write
+ @param[in] handle target handle of detected tag
+ @param[in] addr block or starting page number
+ @param[in] data data to write
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] addr block
- @param[in] value index of block to increase, starting from 0
+ @param[in] handle target handle of detected tag
+ @param[in] addr block
+ @param[in] value index of block to increase, starting from 0
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] addr block
- @param[in] value index of block to decrease, starting from 0
+ @param[in] handle target handle of detected tag
+ @param[in] addr block
+ @param[in] value index of block to decrease, starting from 0
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] addr block
- @param[in] value index of block to decrease, starting from 0
+ @param[in] handle target handle of detected tag
+ @param[in] addr block
+ @param[in] value index of block to decrease, starting from 0
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] handle target handle of detected tag
- @param[in] addr block
- @param[in] value index of block to decrease, starting from 0
+ @param[in] handle target handle of detected tag
+ @param[in] addr block
+ @param[in] value index of block to decrease, starting from 0
@return return the result of the calling the function
@exception NET_NFC_NULL_PARAMETER parameter has illigal NULL pointer
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
@exception NET_NFC_NOT_INITIALIZED Try to operate without initialization
@exception NET_NFC_BUSY Device is too busy to handle your request
@exception NET_NFC_OPERATION_FAIL Operation is failed because of the
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] key the handle to create key
+ @param[in] key the handle to create key
@return return the result of the calling the function
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] key the handle to create key
+ @param[in] key the handle to create key
@return return the result of the calling the function
\par Sync (or) Async: Sync
This is a Asynchronous API
- @param[in] key the handle to create key
+ @param[in] key the handle to create key
@return return the result of the calling the function
}
#endif
-#endif //__NET_NFC_TAG_MIFARE_H__
+#endif /* __NET_NFC_TAG_MIFARE_H__ */
@{
This document is for the APIs reference document
- NFC Manager defines are defined in <nfc-typedef.h>
-
- These APIs help to get information of detected target. these target info handler holds
- - type of target
- - target ID
- - ndef message supporting
- - max data size (if this tag is ndef message tag)
- - actual data size (if this tag is ndef message tag)
+ NFC Manager defines are defined in <nfc-typedef.h>
+
+ These APIs help to get information of detected target. these target info handler holds
+ - type of target
+ - target ID
+ - ndef message supporting
+ - max data size (if this tag is ndef message tag)
+ - actual data size (if this tag is ndef message tag)
*/
/**
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] target_info target info handler
+ @param[in] target_info target info handler
@param[out] type tag type these type is one of the enum "net_nfc_target_type_e" defined
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] target_info target info handler
+ @param[in] target_info target info handler
@param[out] handle target handle that is generated by nfc-manager
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] target_info target info handler
+ @param[in] target_info target info handler
@param[out] is_support boolean value of NDEF supporting
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] target_info target info handler
+ @param[in] target_info target info handler
@param[out] state ndef tag state
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
net_nfc_error_e net_nfc_get_tag_ndef_state(net_nfc_target_info_h target_info, net_nfc_ndef_card_state_e *state);
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] target_info target info handler
+ @param[in] target_info target info handler
@param[out] max_size max size of NDEF message that can be stored in this detected tag.
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] target_info target info handler
+ @param[in] target_info target info handler
@param[out] actual_data the actual NDEF message size that stored in the tag
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
\par Sync (or) Async: Sync
This is a Synchronous API. keys will be freed by user.
- @param[in] target_info target info handler
- @param[out] keys pointer of double array. it will be array of string.
+ @param[in] target_info target info handler
+ @param[out] keys pointer of double array. it will be array of string.
@param[out] number_of_keys length of array.
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
- @exception NET_NFC_ALLOC_FAIL memory allocation is failed
- @exception NET_NFC_NO_DATA_FOUND No data is returned
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_ALLOC_FAIL memory allocation is failed
+ @exception NET_NFC_NO_DATA_FOUND No data is returned
@code
void user_cb(net_nfc_message_e message, net_nfc_error_e result, void* data, void* trans_param)
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] target_info target info handler
+ @param[in] target_info target info handler
@param[in] key key to retrieve
@param[out] value value which is matched with key
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
- @exception NET_NFC_NO_DATA_FOUND No data is returned
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NO_DATA_FOUND No data is returned
*/
net_nfc_error_e net_nfc_get_tag_info_value(net_nfc_target_info_h target_info, const char *key, data_h *value);
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] target_info target info handler
+ @param[in] target_info target info handler
@param[out] msg ndef message
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
net_nfc_error_e net_nfc_get_tag_ndef_message(net_nfc_target_info_h target_info, ndef_message_h *msg);
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] origin The original handle you want to duplicate
- @param[out] result The result of this function.
+ @param[in] origin The original handle you want to duplicate
+ @param[out] result The result of this function.
@code
void user_cb(net_nfc_message_e message, net_nfc_error_e result, void *data, void *trans_param)
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
net_nfc_error_e net_nfc_duplicate_target_info(net_nfc_target_info_h origin, net_nfc_target_info_h *result);
\par Sync (or) Async: Sync
This is a Synchronous API
- @param[in] target_info target info handle
+ @param[in] target_info target info handle
@code
net_nfc_target_info_h handle;
@return return the result of calling this functions
- @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
+ @exception NET_NFC_NULL_PARAMETER parameter(s) has(have) illegal NULL pointer(s)
*/
net_nfc_error_e net_nfc_release_tag_info(net_nfc_target_info_h target_info);
#endif
-#endif //__NET_NFC_TARGET_INFO_H__
+#endif /* __NET_NFC_TARGET_INFO_H__ */
*/
typedef void (*nfc_connection_handover_event_cb)(nfc_error_e result, nfc_handover_event_e event, nfc_ac_type_e carrier, char *address, nfc_ndef_message_h msg, void *user_data);
-typedef bool (*nfc_se_registered_handler_cb)(const char *handler, int count,
- void *user_data);
+typedef bool (*nfc_se_registered_handler_cb)(const char *handler, int count, void *user_data);
/**
* @brief NFC Connection handover between NFC peer-to-peer target
{
net_nfc_error_e ret;
- if (state != NULL)
- {
+ if (state != NULL) {
if (vconf_get_bool(VCONFKEY_NFC_FEATURE, state) == 0)
- {
ret = NET_NFC_OK;
- }
else
- {
ret = NET_NFC_INVALID_STATE;
- }
- }
- else
- {
+ } else {
ret = NET_NFC_NULL_PARAMETER;
}
{
net_nfc_error_e ret;
- if (state != NULL)
- {
+ if (state != NULL) {
if (vconf_get_bool(VCONFKEY_NFC_STATE, state) == 0)
- {
ret = NET_NFC_OK;
- }
else
- {
ret = NET_NFC_INVALID_STATE;
- }
- }
- else
- {
+ } else {
ret = NET_NFC_NULL_PARAMETER;
}
data_s *tmp_data = NULL;
if (data == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*data = NULL;
return NET_NFC_ALLOC_FAIL;
if (length > 0 && bytes != NULL)
- {
memcpy(tmp_data->buffer, bytes, length);
- }
*data = (data_h)tmp_data;
*length = 0;
if (data == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*bytes = tmp_data->buffer;
*length = tmp_data->length;
data_s *tmp_data = (data_s *)data;
if (data == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
if (tmp_data->buffer == bytes && tmp_data->length == length)
- {
return NET_NFC_OK;
- }
net_nfc_util_clear_data(tmp_data);
- if (length > 0)
- {
+ if (length > 0) {
net_nfc_util_init_data(tmp_data, length);
if (bytes != NULL)
- {
memcpy(tmp_data->buffer, bytes, length);
- }
}
return NET_NFC_OK;
data_s *tmp_data = (data_s *)data;
if (data == NULL)
- {
return 0;
- }
return tmp_data->length;
}
data_s *tmp_data = (data_s *)data;
if (data == NULL)
- {
return NULL;
- }
return tmp_data->buffer;
}
data_s *tmp_data = (data_s *)data;
if (data == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
if (tmp_data->buffer != NULL)
- {
_net_nfc_util_free_mem(tmp_data->buffer);
- }
+
_net_nfc_util_free_mem(tmp_data);
return NET_NFC_OK;
#define NET_NFC_EXPORT_API __attribute__((visibility("default")))
#endif
-typedef struct _handover_handler_t
-{
+typedef struct _handover_handler_t {
net_nfc_connection_handover_event_cb handover_event_cb;
gpointer handover_event_data;
}
g_assert(user_data != NULL);
- if (handover_proxy == NULL)
- {
- if (net_nfc_client_handover_init() != NET_NFC_OK)
- {
+ if (handover_proxy == NULL) {
+ if (net_nfc_client_handover_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("handover_proxy fail");
/* FIXME : return result of this error */
return;
(gint *)&type,
&data,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish"
" connection handover: %s", error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_p2p_connection_handover_completed_cb callback =
(net_nfc_p2p_connection_handover_completed_cb)func_data->callback;
return NET_NFC_NULL_PARAMETER;
if (info->data.buffer != NULL)
- {
_net_nfc_util_free_mem(info->data.buffer);
- }
_net_nfc_util_free_mem(info);
net_nfc_target_handle_s *tag_handle = (net_nfc_target_handle_s *)handle;
NetNfcCallback *funcdata;
- if (handover_proxy == NULL)
- {
- if(net_nfc_client_handover_init() != NET_NFC_OK)
- {
+ if (handover_proxy == NULL) {
+ if (net_nfc_client_handover_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("handover_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
- }
+ }
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
funcdata = g_try_new0(NetNfcCallback, 1);
- if (funcdata == NULL) {
+ if (funcdata == NULL)
return NET_NFC_ALLOC_FAIL;
- }
funcdata->callback = (gpointer)callback;
funcdata->user_data = cb_data;
NET_NFC_CONN_HANDOVER_CARRIER_UNKNOWN;
GError *error = NULL;
- if (handover_proxy == NULL)
- {
- if(net_nfc_client_handover_init() != NET_NFC_OK)
- {
+ if (handover_proxy == NULL) {
+ if (net_nfc_client_handover_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("handover_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_handover_call_request_sync(handover_proxy,
GPOINTER_TO_UINT(tag_handle),
&out_data,
NULL,
&error) == TRUE) {
- if (out_carrier) {
+ if (out_carrier)
*out_carrier = out_type;
- }
- if (out_ac_data) {
+ if (out_ac_data)
*out_ac_data = net_nfc_util_gdbus_variant_to_data(out_data);
- }
} else {
- DEBUG_ERR_MSG("handover (sync call) failed: %s",error->message);
+ DEBUG_ERR_MSG("handover (sync call) failed: %s", error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
if (callback == NULL)
return;
- if (handover_proxy == NULL)
- {
- if (net_nfc_client_handover_init() != NET_NFC_OK)
- {
+ if (handover_proxy == NULL) {
+ if (net_nfc_client_handover_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("handover_proxy fail");
return;
}
{
GError *error = NULL;
- if (handover_proxy)
- {
+ if (handover_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/Handover",
NULL,
&error);
- if (handover_proxy == NULL)
- {
+ if (handover_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_handover_deinit(void)
{
- if (handover_proxy)
- {
+ if (handover_proxy) {
g_object_unref(handover_proxy);
handover_proxy = NULL;
}
typedef struct _HceHandler HceHandler;
-struct _HceHandler
-{
+struct _HceHandler {
net_nfc_client_hce_event_cb hce_event_cb;
gpointer hce_data;
};
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (callback == NULL) {
+ if (callback == NULL)
return net_nfc_client_hce_unset_event_received_cb();
- }
- if (hce_proxy == NULL)
- {
+ if (hce_proxy == NULL) {
result = net_nfc_client_hce_init();
- if (result != NET_NFC_OK)
- {
+ if (result != NET_NFC_OK) {
DEBUG_ERR_MSG("net_nfc_client_hce_init failed, [%d]", result);
return result;
INFO_MSG(">>> net_nfc_client_hce_response_apdu_sync!!");
- if (hce_proxy == NULL)
- {
+ if (hce_proxy == NULL) {
result = net_nfc_client_hce_init();
- if (result != NET_NFC_OK)
- {
+ if (result != NET_NFC_OK) {
DEBUG_ERR_MSG("net_nfc_client_hce_init failed, [%d]", result);
return result;
}
arg_data = net_nfc_util_gdbus_data_to_variant((data_s *)resp_apdu_data);
- if (arg_data == NULL)
- {
+ if (arg_data == NULL) {
INFO_MSG(">>> resp_apdu_data is null !!");
return NET_NFC_INVALID_PARAM;
DEBUG_CLIENT_MSG("net_nfc_client_hce_init call");
- if (hce_proxy)
- {
+ if (hce_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
NULL,
&error);
- if (hce_proxy == NULL)
- {
+ if (hce_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_hce_deinit(void)
{
- if (hce_proxy != NULL)
- {
+ if (hce_proxy != NULL) {
net_nfc_client_hce_ipc_deinit();
g_object_unref(hce_proxy);
static guint hce_client_src_id = 0;
/* static function */
-
-/////////////////////
static void __set_non_block_socket(int socket)
{
int flags;
flags = fcntl(socket, F_GETFL);
flags |= O_NONBLOCK;
- if (fcntl(socket, F_SETFL, flags) < 0) {
+ if (fcntl(socket, F_SETFL, flags) < 0)
DEBUG_ERR_MSG("fcntl, executing nonblock error");
- }
}
static bool __receive_data_from_server(int socket, data_s *data)
/* second, receive buffer */
do {
ret = recv(socket, data->buffer + offset, data->length - offset, 0);
- if (ret == -1) {
+ if (ret == -1)
break;
- }
offset += ret;
} while (offset < len);
data_s temp;
uint32_t len = sizeof(net_nfc_hce_data_t);
- if (data != NULL && data->length > 0) {
+ if (data != NULL && data->length > 0)
len += data->length;
- }
ret = net_nfc_util_init_data(&temp, len + sizeof(len));
if (ret == true) {
header->type = type;
header->handle = GPOINTER_TO_UINT(handle);
- if (data != NULL && data->length > 0) {
+ if (data != NULL && data->length > 0)
memcpy(header->data, data->buffer, data->length);
- }
ret = __send_data_to_server(hce_client_socket, &temp);
return FALSE;
} else if (G_IO_IN & condition) {
- if(channel != hce_client_channel) {
+ if (channel != hce_client_channel) {
DEBUG_CLIENT_MSG("unknown channel");
return FALSE;
socklen_t len_saddr = 0;
pthread_mutexattr_t attr;
- if (net_nfc_client_hce_ipc_is_initialized() == true)
- {
+ if (net_nfc_client_hce_ipc_is_initialized() == true) {
DEBUG_CLIENT_MSG("client is already initialized");
return NET_NFC_ALREADY_INITIALIZED;
net_nfc_client_ipc_lock();
hce_client_socket = socket(AF_UNIX, SOCK_STREAM, 0);
- if (hce_client_socket == -1)
- {
+ if (hce_client_socket == -1) {
DEBUG_ERR_MSG("get socket is failed");
result = NET_NFC_IPC_FAIL;
return NET_NFC_OK;
-ERROR :
+ERROR:
DEBUG_ERR_MSG("error while initializing client ipc");
net_nfc_client_ipc_unlock();
void net_nfc_client_hce_ipc_deinit()
{
- if (net_nfc_client_hce_ipc_is_initialized() == true) {
+ if (net_nfc_client_hce_ipc_is_initialized() == true)
_finalize_client_socket();
- }
}
typedef struct _LlcpFuncData LlcpFuncData;
-struct _LlcpFuncData
-{
+struct _LlcpFuncData {
gpointer callback;
gpointer user_data;
};
if (socket_data_list == NULL)
return;
- if (socket_data)
- {
+ if (socket_data) {
socket_data_list = g_list_append(socket_data_list,
socket_data);
}
if (socket_data_list == NULL)
return;
- if (socket_data)
- {
+ if (socket_data) {
socket_data_list = g_list_remove(socket_data_list,
socket_data);
return NULL;
- for (pos = g_list_first(socket_data_list); pos ; pos = pos->data)
- {
+ for (pos = g_list_first(socket_data_list); pos ; pos = pos->data) {
net_nfc_llcp_internal_socket_s *data;
data = pos->data;
NET_NFC_GDBUS_LLCP(source_object),
&result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish config: %s",
error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_config_completed callback =
(net_nfc_client_llcp_config_completed)func_data->callback;
&result,
&out_client_socket,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish listen: %s",
error->message);
result = NET_NFC_IPC_FAIL;
}
socket_data = llcp_socket_data_find(out_client_socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return;
}
socket_data->oal_socket = out_oal_socket;
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_listen_completed callback =
(net_nfc_client_llcp_listen_completed)func_data->callback;
}
/* TODO : release resource when socket is closed */
-// g_free(func_data);
+ /* g_free(func_data); */
}
static void llcp_call_accept(GObject *source_object,
NET_NFC_GDBUS_LLCP(source_object),
&result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish accept: %s",
error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_accept_completed callback =
(net_nfc_client_llcp_accept_completed)func_data->callback;
NET_NFC_GDBUS_LLCP(source_object),
&result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish reject: %s",
error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_reject_completed callback =
(net_nfc_client_llcp_reject_completed)func_data->callback;
&result,
&out_client_socket,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish connect: %s", error->message);
result = NET_NFC_IPC_FAIL;
}
socket_data = llcp_socket_data_find(out_client_socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return;
}
socket_data->oal_socket = out_oal_socket;
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_connect_completed callback =
(net_nfc_client_llcp_connect_completed)func_data->callback;
}
/* TODO : release resource when socket is closed */
-// g_free(func_data);
+ /* g_free(func_data); */
}
static void llcp_call_connect_sap(GObject *source_object,
&result,
&out_client_socket,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish connect sap: %s", error->message);
result = NET_NFC_IPC_FAIL;
}
socket_data = llcp_socket_data_find(out_client_socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return;
}
socket_data->oal_socket = out_oal_socket;
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_connect_sap_completed callback =
(net_nfc_client_llcp_connect_sap_completed)func_data->callback;
}
/* TODO : release resource when socket is closed */
-// g_free(func_data);
+ /* g_free(func_data); */
}
static void llcp_call_send(GObject *source_object,
&result,
&out_client_socket,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish send: %s",
error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_send_completed callback =
(net_nfc_client_llcp_send_completed)func_data->callback;
&result,
&out_client_socket,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish send to: %s", error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_send_to_completed callback =
(net_nfc_client_llcp_send_to_completed)func_data->callback;
&result,
&variant,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish receive: %s", error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_receive_completed callback =
(net_nfc_client_llcp_receive_completed)func_data->callback;
data_s data = { NULL, 0 };
&sap,
&variant,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish receive from: %s",
error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_receive_from_completed callback =
(net_nfc_client_llcp_receive_from_completed)func_data->callback;
data_s data = { NULL, 0 };
&result,
&out_client_socket,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish close: %s", error->message);
result = NET_NFC_IPC_FAIL;
}
socket_data = llcp_socket_data_find(out_client_socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return;
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_llcp_close_completed callback =
(net_nfc_client_llcp_close_completed)func_data->callback;
&result,
&out_client_socket,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish disconnect: %s", error->message);
result = NET_NFC_IPC_FAIL;
}
socket_data = llcp_socket_data_find(out_client_socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return;
}
LlcpFuncData *func_data;
GVariant *variant;
- if (config == NULL) {
+ if (config == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
GVariant *variant = NULL;
GError *error = NULL;
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
memcpy(&llcp_config, config, sizeof(net_nfc_llcp_config_info_s));
variant,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not config: %s", error->message);
result = NET_NFC_IPC_FAIL;
LlcpFuncData *func_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
socket_data->sap = sap;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
net_nfc_llcp_internal_socket_s *socket_data = NULL;
net_nfc_llcp_internal_socket_s *out_socket_data = NULL;
- if (out_socket == NULL) {
+ if (out_socket == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
- if (service_name == NULL)
- {
+ if (service_name == NULL) {
DEBUG_ERR_MSG("service_name is empty");
return NET_NFC_UNKNOWN_ERROR;
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
socket_data->sap = sap;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_llcp_call_listen_sync(llcp_proxy,
GPOINTER_TO_UINT(llcp_handle),
NULL,
&error) == true) {
out_socket_data = llcp_socket_data_find(out_client_socket);
- if (out_socket_data == NULL || out_socket_data != socket_data)
- {
+ if (out_socket_data == NULL || out_socket_data != socket_data) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return NET_NFC_UNKNOWN_ERROR;
}
-// out_socket_data->oal_socket = out_oal_socket;
+ /* out_socket_data->oal_socket = out_oal_socket; */
if (out_socket)
*out_socket = out_client_socket;
{
LlcpFuncData *func_data;
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
net_nfc_error_e result;
GError *error = NULL;
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_llcp_call_accept_sync(llcp_proxy,
GPOINTER_TO_UINT(llcp_handle),
{
LlcpFuncData *func_data;
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
net_nfc_error_e result;
GError *error = NULL;
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_llcp_call_reject_sync(llcp_proxy,
GPOINTER_TO_UINT(llcp_handle),
LlcpFuncData *func_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
- if (service_name == NULL) {
+ if (service_name == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
net_nfc_llcp_internal_socket_s *socket_data = NULL;
net_nfc_llcp_internal_socket_s *out_socket_data = NULL;
- if (service_name == NULL || out_socket == NULL) {
+ if (service_name == NULL || out_socket == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_llcp_call_connect_sync(llcp_proxy,
GPOINTER_TO_UINT(llcp_handle),
NULL,
&error) == true) {
out_socket_data = llcp_socket_data_find(out_client_socket);
- if (out_socket_data == NULL || out_socket_data != socket_data)
- {
+ if (out_socket_data == NULL || out_socket_data != socket_data) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return NET_NFC_UNKNOWN_ERROR;
}
-// out_socket_data->oal_socket = out_oal_socket;
+ /*out_socket_data->oal_socket = out_oal_socket;*/
if (out_socket)
*out_socket = out_client_socket;
LlcpFuncData *func_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
- if (sap == 0) {
+ if (sap == 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
net_nfc_llcp_internal_socket_s *socket_data = NULL;
net_nfc_llcp_internal_socket_s *out_socket_data = NULL;
- if (out_socket == NULL) {
+ if (out_socket == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (sap == 0) {
+ if (sap == 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_llcp_call_connect_sap_sync(llcp_proxy,
GPOINTER_TO_UINT(llcp_handle),
NULL,
&error) == true) {
out_socket_data = llcp_socket_data_find(out_client_socket);
- if (out_socket_data == NULL || out_socket_data != socket_data)
- {
+ if (out_socket_data == NULL || out_socket_data != socket_data) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return NET_NFC_UNKNOWN_ERROR;
}
-// out_socket_data->oal_socket = out_oal_socket;
+ /* out_socket_data->oal_socket = out_oal_socket; */
if (out_socket)
*out_socket = out_client_socket;
GVariant *variant;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
- if (data == NULL) {
+ if (data == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (socket <= 0) {
+ if (socket <= 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
net_nfc_llcp_internal_socket_s *socket_data;
net_nfc_llcp_internal_socket_s *out_socket_data;
- if (data == NULL) {
+ if (data == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (socket <= 0) {
+ if (socket <= 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
variant = net_nfc_util_gdbus_data_to_variant(data);
NULL,
&error) == true) {
out_socket_data = llcp_socket_data_find(out_client_socket);
- if (out_socket_data == NULL)
- {
+ if (out_socket_data == NULL) {
DEBUG_ERR_MSG("can not find socket_data");
return NET_NFC_UNKNOWN_ERROR;
}
GVariant *variant;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
- if (data == NULL) {
+ if (data == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (socket <= 0 || sap == 0) {
+ if (socket <= 0 || sap == 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
net_nfc_llcp_internal_socket_s *socket_data;
net_nfc_llcp_internal_socket_s *out_socket_data;
- if (data == NULL) {
+ if (data == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (socket <= 0 || sap == 0) {
+ if (socket <= 0 || sap == 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
variant = net_nfc_util_gdbus_data_to_variant(data);
NULL,
&error) == true) {
out_socket_data = llcp_socket_data_find(out_client_socket);
- if (out_socket_data == NULL)
- {
+ if (out_socket_data == NULL) {
DEBUG_ERR_MSG("can not find socket_data");
return NET_NFC_UNKNOWN_ERROR;
}
LlcpFuncData *func_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
- if (socket <= 0 || request_length == 0) {
+ if (socket <= 0 || request_length == 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
GError *error = NULL;
net_nfc_llcp_internal_socket_s *socket_data;
- if (out_data == NULL) {
+ if (out_data == NULL)
return NET_NFC_NULL_PARAMETER;
- }
*out_data = NULL;
- if (socket <= 0 || request_length == 0) {
+ if (socket <= 0 || request_length == 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_llcp_call_receive_sync(llcp_proxy,
GPOINTER_TO_UINT(llcp_handle),
LlcpFuncData *func_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
- if (socket <= 0 || request_length == 0) {
+ if (socket <= 0 || request_length == 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
net_nfc_llcp_internal_socket_s *socket_data;
- if (out_sap == NULL || out_data == NULL) {
+ if (out_sap == NULL || out_data == NULL)
return NET_NFC_NULL_PARAMETER;
- }
*out_data = NULL;
*out_sap = 0;
- if (socket <= 0 || request_length == 0) {
+ if (socket <= 0 || request_length == 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_llcp_call_receive_from_sync(llcp_proxy,
GPOINTER_TO_UINT(llcp_handle),
LlcpFuncData *func_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
- if (socket <= 0) {
+ if (socket <= 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
net_nfc_llcp_internal_socket_s *socket_data = NULL;
net_nfc_llcp_internal_socket_s *out_socket_data = NULL;
- if (socket <= 0) {
+ if (socket <= 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_llcp_call_close_sync(llcp_proxy,
GPOINTER_TO_UINT(llcp_handle),
NULL,
&error) == true) {
out_socket_data = llcp_socket_data_find(out_client_socket);
- if (out_socket_data == NULL || out_socket_data != socket_data)
- {
+ if (out_socket_data == NULL || out_socket_data != socket_data) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return NET_NFC_UNKNOWN_ERROR;
}
LlcpFuncData *func_data;
net_nfc_llcp_internal_socket_s *socket_data = NULL;
- if (socket <= 0) {
+ if (socket <= 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_new0(LlcpFuncData, 1);
if (func_data == NULL) {
net_nfc_llcp_internal_socket_s *socket_data = NULL;
net_nfc_llcp_internal_socket_s *out_socket_data = NULL;
- if (socket <= 0) {
+ if (socket <= 0)
return NET_NFC_INVALID_PARAM;
- }
- if (llcp_proxy == NULL)
- {
- if(net_nfc_client_llcp_init() != NET_NFC_OK)
- {
+ if (llcp_proxy == NULL) {
+ if (net_nfc_client_llcp_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("llcp_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
socket_data = llcp_socket_data_find(socket);
- if (socket_data == NULL)
- {
+ if (socket_data == NULL) {
DEBUG_ERR_MSG("can not get socket_data");
return NET_NFC_LLCP_INVALID_SOCKET;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_llcp_call_disconnect_sync(llcp_proxy,
GPOINTER_TO_UINT(llcp_handle),
NULL,
&error) == true) {
out_socket_data = llcp_socket_data_find(out_client_socket);
- if (out_socket_data == NULL || out_socket_data != socket_data)
- {
+ if (out_socket_data == NULL || out_socket_data != socket_data) {
DEBUG_ERR_MSG("Wrong client socket is returned");
return NET_NFC_UNKNOWN_ERROR;
}
socket_data->client_socket = socket_handle++;
- if (option)
- {
+ if (option) {
socket_data->miu = option->miu;
socket_data->rw = option->rw;
socket_data->type = option->type;
- }
- else
- {
+ } else {
socket_data->miu = 128;
socket_data->rw = 1;
socket_data->type =
socket_data->device_id = llcp_handle;
socket_data->close_requested = false;
-
if (socket)
*socket = socket_data->client_socket;
}
net_nfc_llcp_config_info_h *config)
{
if (config == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*config = (net_nfc_llcp_config_info_h)&llcp_config;
net_nfc_llcp_socket_option_s *struct_option = NULL;
if (option == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
if (miu < 128 || miu > 1152 ||
rw < 1 || rw > 15 ||
type < NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONORIENTED ||
- type > NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONLESS)
- {
+ type > NET_NFC_LLCP_SOCKET_TYPE_CONNECTIONLESS) {
return NET_NFC_OUT_OF_BOUND;
}
_net_nfc_util_alloc_mem(struct_option, sizeof(net_nfc_llcp_socket_option_s));
- if (struct_option != NULL)
- {
+ if (struct_option != NULL) {
struct_option->miu = miu;
struct_option->rw = rw;
struct_option->type = type;
*option = (net_nfc_llcp_socket_option_h)struct_option;
return NET_NFC_OK;
- }
- else
- {
+ } else {
return NET_NFC_ALLOC_FAIL;
}
}
(net_nfc_llcp_socket_option_s *)option;
if (option == NULL || miu == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*miu = struct_option->miu;
(net_nfc_llcp_socket_option_s *)option;
if (option == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
struct_option->miu = miu;
uint8_t *rw)
{
if (option == NULL || rw == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
+
net_nfc_llcp_socket_option_s *struct_option = (net_nfc_llcp_socket_option_s *)option;
*rw = struct_option->rw;
uint8_t rw)
{
if (option == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
+
net_nfc_llcp_socket_option_s *struct_option = (net_nfc_llcp_socket_option_s *)option;
struct_option->rw = rw;
net_nfc_socket_type_e * type)
{
if (option == NULL || type == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
+
net_nfc_llcp_socket_option_s *struct_option = (net_nfc_llcp_socket_option_s *)option;
*type = struct_option->type;
net_nfc_socket_type_e type)
{
if (option == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
+
net_nfc_llcp_socket_option_s *struct_option = (net_nfc_llcp_socket_option_s *)option;
struct_option->type = type;
net_nfc_llcp_socket_option_h option)
{
if (option == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
_net_nfc_util_free_mem(option);
uint8_t option)
{
if (config == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
net_nfc_llcp_config_info_s **tmp_config =
(net_nfc_llcp_config_info_s **)config;
uint16_t *miu)
{
if (config == NULL || miu == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
net_nfc_llcp_config_info_s *tmp_config =
(net_nfc_llcp_config_info_s *)config;
uint16_t *wks)
{
if (config == NULL || wks == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
net_nfc_llcp_config_info_s *tmp_config =
(net_nfc_llcp_config_info_s *)config;
uint8_t *lto)
{
if (config == NULL || lto == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
net_nfc_llcp_config_info_s *tmp_config =
(net_nfc_llcp_config_info_s *)config;
uint8_t *option)
{
if (config == NULL || option == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
net_nfc_llcp_config_info_s *tmp_config =
(net_nfc_llcp_config_info_s *)config;
uint16_t miu)
{
if (config == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
if (miu < 128 || miu > 1152)
- {
return NET_NFC_OUT_OF_BOUND;
- }
net_nfc_llcp_config_info_s * tmp_config =
(net_nfc_llcp_config_info_s *)config;
uint16_t wks)
{
if (config == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
net_nfc_llcp_config_info_s *tmp_config =
(net_nfc_llcp_config_info_s *)config;
uint8_t lto)
{
if (config == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
net_nfc_llcp_config_info_s *tmp_config =
(net_nfc_llcp_config_info_s *)config;
uint8_t option)
{
if (config == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
net_nfc_llcp_config_info_s * tmp_config =
(net_nfc_llcp_config_info_s *)config;
net_nfc_error_e net_nfc_client_llcp_free_config(net_nfc_llcp_config_info_h config)
{
if (config == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
_net_nfc_util_free_mem(config);
return NET_NFC_OK;
{
GError *error = NULL;
- if (llcp_proxy)
- {
+ if (llcp_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/Llcp",
NULL,
&error);
- if (llcp_proxy == NULL)
- {
+ if (llcp_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_llcp_deinit(void)
{
- if (llcp_proxy)
- {
+ if (llcp_proxy) {
g_object_unref(llcp_proxy);
llcp_proxy = NULL;
}
typedef struct _ManagerFuncData ManagerFuncData;
-struct _ManagerFuncData
-{
+struct _ManagerFuncData {
gpointer callback;
gpointer user_data;
net_nfc_error_e result;
NET_NFC_GDBUS_MANAGER(source_object),
&result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish call_set_active: %s",
error->message);
result = NET_NFC_IPC_FAIL;
&result,
&out_state,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish get_server_state: %s",
error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_manager_get_server_state_completed callback =
(net_nfc_client_manager_get_server_state_completed)func_data->callback;
/* update current state */
is_activated = (int)activated;
- if (activated_func_data.callback != NULL)
- {
+ if (activated_func_data.callback != NULL) {
if (is_activated == false) {
/* FIXME : wait several times */
timeout_id[1] = g_timeout_add(DEACTIVATE_DELAY,
if (callback == NULL)
return;
- if (manager_proxy == NULL)
- {
- if (net_nfc_client_manager_init() != NET_NFC_OK)
- {
+ if (manager_proxy == NULL) {
+ if (net_nfc_client_manager_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("manager_proxy fail");
/* FIXME : return result of this error */
return;
"/org/tizen/NetNfcService/Manager",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
"/org/tizen/NetNfcService/Manager",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
(gboolean)state,
&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call SetActive: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
return NET_NFC_NOT_INITIALIZED;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(NetNfcCallback, 1);
if (func_data == NULL)
return NET_NFC_NOT_INITIALIZED;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_manager_call_get_server_state_sync(manager_proxy,
&out_result,
&out_state,
NULL,
- &error) == TRUE)
- {
+ &error) == TRUE) {
*state = out_state;
- }
- else
- {
+ } else {
DEBUG_ERR_MSG("can not call GetServerState: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
{
GError *error = NULL;
- if (manager_proxy)
- {
+ if (manager_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/Manager",
NULL,
&error);
- if (manager_proxy == NULL)
- {
+ if (manager_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_manager_deinit(void)
{
- if (manager_proxy)
- {
+ if (manager_proxy) {
int i;
for (i = 0; i < 2; i++) {
/* internal function */
bool net_nfc_client_manager_is_activated()
{
- if (is_activated < 0) {
+ if (is_activated < 0)
net_nfc_client_get_nfc_state(&is_activated);
- }
return is_activated;
}
net_nfc_target_info_s *target_info = NULL;
target_info = net_nfc_client_tag_get_client_target_info();
- if (target_info == NULL)
- {
+ if (target_info == NULL) {
DEBUG_ERR_MSG("target_info does not exist");
return FALSE;
}
- switch (target_info->devType)
- {
- case NET_NFC_ISO14443_A_PICC :
- case NET_NFC_MIFARE_MINI_PICC :
- case NET_NFC_MIFARE_1K_PICC :
- case NET_NFC_MIFARE_4K_PICC :
- case NET_NFC_MIFARE_ULTRA_PICC :
- case NET_NFC_JEWEL_PICC :
- return TRUE;
- break;
- default:
- DEBUG_CLIENT_MSG(
- "not supported tag for read only tag");
- return FALSE;
+ switch (target_info->devType) {
+ case NET_NFC_ISO14443_A_PICC:
+ case NET_NFC_MIFARE_MINI_PICC:
+ case NET_NFC_MIFARE_1K_PICC:
+ case NET_NFC_MIFARE_4K_PICC:
+ case NET_NFC_MIFARE_ULTRA_PICC:
+ case NET_NFC_JEWEL_PICC:
+ return TRUE;
+ break;
+ default:
+ DEBUG_CLIENT_MSG(
+ "not supported tag for read only tag");
+ return FALSE;
}
}
(gint *)&out_result,
&out_data,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish read: %s", error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_ndef_read_completed callback =
(net_nfc_client_ndef_read_completed)func_data->callback;
ndef_message_h message;
NET_NFC_GDBUS_NDEF(source_object),
(gint *)&out_result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish write: %s", error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_ndef_write_completed callback =
(net_nfc_client_ndef_write_completed)func_data->callback;
NET_NFC_GDBUS_NDEF(source_object),
(gint *)&out_result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish make read only: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_ndef_make_read_only_completed callback =
(net_nfc_client_ndef_make_read_only_completed)func_data->callback;
NET_NFC_GDBUS_NDEF(source_object),
(gint *)&out_result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish format: %s", error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_ndef_format_completed callback =
(net_nfc_client_ndef_format_completed)func_data->callback;
if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if (ndef_proxy == NULL)
- {
- if(net_nfc_client_ndef_init() != NET_NFC_OK)
- {
+ if (ndef_proxy == NULL) {
+ if (net_nfc_client_ndef_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
DEBUG_CLIENT_MSG("send request :: read ndef = [%p]", handle);
func_data = g_try_new0(NetNfcCallback, 1);
- if (func_data == NULL) {
+ if (func_data == NULL)
return NET_NFC_ALLOC_FAIL;
- }
func_data->callback = (gpointer)callback;
func_data->user_data = user_data;
if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if (ndef_proxy == NULL)
- {
- if(net_nfc_client_ndef_init() != NET_NFC_OK)
- {
+ if (ndef_proxy == NULL) {
+ if (net_nfc_client_ndef_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
if (handle == NULL || message == NULL)
return NET_NFC_NULL_PARAMETER;
- if (ndef_proxy == NULL)
- {
- if(net_nfc_client_ndef_init() != NET_NFC_OK)
- {
+ if (ndef_proxy == NULL) {
+ if (net_nfc_client_ndef_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
func_data = g_try_new0(NetNfcCallback, 1);
- if (func_data == NULL) {
+ if (func_data == NULL)
return NET_NFC_ALLOC_FAIL;
- }
func_data->callback = (gpointer)callback;
func_data->user_data = user_data;
if (handle == NULL || message == NULL)
return NET_NFC_NULL_PARAMETER;
- if (ndef_proxy == NULL)
- {
- if(net_nfc_client_ndef_init() != NET_NFC_OK)
- {
+ if (ndef_proxy == NULL) {
+ if (net_nfc_client_ndef_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
arg_data,
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call write: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if (ndef_proxy == NULL)
- {
- if(net_nfc_client_ndef_init() != NET_NFC_OK)
- {
+ if (ndef_proxy == NULL) {
+ if (net_nfc_client_ndef_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
return NET_NFC_NOT_SUPPORTED;
func_data = g_try_new0(NetNfcCallback, 1);
- if (func_data == NULL) {
+ if (func_data == NULL)
return NET_NFC_ALLOC_FAIL;
- }
func_data->callback = (gpointer)callback;
func_data->user_data = user_data;
if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if (ndef_proxy == NULL)
- {
- if(net_nfc_client_ndef_init() != NET_NFC_OK)
- {
+ if (ndef_proxy == NULL) {
+ if (net_nfc_client_ndef_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
GPOINTER_TO_UINT(handle),
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not make read only: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if (ndef_proxy == NULL)
- {
- if(net_nfc_client_ndef_init() != NET_NFC_OK)
- {
+ if (ndef_proxy == NULL) {
+ if (net_nfc_client_ndef_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
func_data = g_try_new0(NetNfcCallback, 1);
- if (func_data == NULL) {
+ if (func_data == NULL)
return NET_NFC_ALLOC_FAIL;
- }
func_data->callback = (gpointer)callback;
func_data->user_data = user_data;
if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if (ndef_proxy == NULL)
- {
- if(net_nfc_client_ndef_init() != NET_NFC_OK)
- {
+ if (ndef_proxy == NULL) {
+ if (net_nfc_client_ndef_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_NOT_CONNECTED;
arg_data,
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call format: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
{
GError *error = NULL;
- if (ndef_proxy)
- {
+ if (ndef_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/Ndef",
NULL,
&error);
- if (ndef_proxy == NULL)
- {
+ if (ndef_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_ndef_deinit(void)
{
- if (ndef_proxy)
- {
+ if (ndef_proxy) {
g_object_unref(ndef_proxy);
ndef_proxy = NULL;
}
net_nfc_error_e result;
data_h data;
- if (ndef_message == NULL || rawdata == NULL) {
+ if (ndef_message == NULL || rawdata == NULL)
return NET_NFC_NULL_PARAMETER;
- }
*rawdata = NULL;
result = net_nfc_get_ndef_message_byte_length(ndef_message, &count);
- if (result != NET_NFC_OK) {
+ if (result != NET_NFC_OK)
return result;
- }
- result = net_nfc_create_data(&data ,NULL, count);
- if (result != NET_NFC_OK) {
+ result = net_nfc_create_data(&data, NULL, count);
+ if (result != NET_NFC_OK)
return result;
- }
result = net_nfc_util_convert_ndef_message_to_rawdata(
(ndef_message_s *)ndef_message, (data_s *)data);
- if (result == NET_NFC_OK) {
+ if (result == NET_NFC_OK)
*rawdata = data;
- } else {
+ else
net_nfc_free_data(data);
- }
return result;
}
net_nfc_error_e result;
ndef_message_h msg;
- if (ndef_message == NULL || rawdata == NULL) {
+ if (ndef_message == NULL || rawdata == NULL)
return NET_NFC_NULL_PARAMETER;
- }
*ndef_message = NULL;
result = net_nfc_create_ndef_message(&msg);
- if (result != NET_NFC_OK) {
+ if (result != NET_NFC_OK)
return result;
- }
result = net_nfc_util_convert_rawdata_to_ndef_message(
(data_s *)rawdata, (ndef_message_s *)msg);
- if (result == NET_NFC_OK) {
+ if (result == NET_NFC_OK)
*ndef_message = msg;
- } else {
+ else
net_nfc_free_ndef_message(msg);
- }
return result;
}
{
net_nfc_error_e result;
- if (ndef_message == NULL || length == NULL){
+ if (ndef_message == NULL || length == NULL)
return NET_NFC_NULL_PARAMETER;
- }
*length = net_nfc_util_get_ndef_message_length(
(ndef_message_s *)ndef_message);
- if (*length > 0) {
+ if (*length > 0)
result = NET_NFC_OK;
- } else {
+ else
result = NET_NFC_INVALID_PARAM;
- }
return result;
}
net_nfc_error_e net_nfc_append_record_to_ndef_message(
ndef_message_h ndef_message, ndef_record_h record)
{
- if (ndef_message == NULL || record == NULL) {
+ if (ndef_message == NULL || record == NULL)
return NET_NFC_NULL_PARAMETER;
- }
return net_nfc_util_append_record((ndef_message_s *)ndef_message,
(ndef_record_s *)record);
NET_NFC_EXPORT_API
net_nfc_error_e net_nfc_free_ndef_message(ndef_message_h ndef_message)
{
- if (ndef_message == NULL) {
+ if (ndef_message == NULL)
return NET_NFC_NULL_PARAMETER;
- }
return net_nfc_util_free_ndef_message((ndef_message_s *)ndef_message);
}
{
ndef_message_s *msg = (ndef_message_s *)ndef_message;
- if (ndef_message == NULL || count == NULL) {
+ if (ndef_message == NULL || count == NULL)
return NET_NFC_NULL_PARAMETER;
- }
*count = msg->recordCount;
FILE *fp = NULL;
if (ndef_message == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
snprintf(file_path, sizeof(file_path), "%s/%s/%s",
NET_NFC_MANAGER_DATA_PATH,
NET_NFC_MANAGER_DATA_PATH_MESSAGE,
NET_NFC_MANAGER_NDEF_FILE_NAME);
- if ((fp = fopen(file_path, "r")) != NULL)
- {
+ if ((fp = fopen(file_path, "r")) != NULL) {
long int size = 0;
/* rewind to start of file */
DEBUG_CLIENT_MSG("message length = [%ld]", size);
- if (size > 0)
- {
+ if (size > 0) {
data_s data = { NULL, 0 };
- if (net_nfc_util_init_data(&data, size) == true)
- {
+ if (net_nfc_util_init_data(&data, size) == true) {
int current;
size_t offset = 0;
break;
} while (offset < data.length);
- if (offset == data.length) {
+ if (offset == data.length)
result = net_nfc_create_ndef_message_from_rawdata(ndef_message, &data);
- } else {
+ else
DEBUG_ERR_MSG("failed to read ndef message");
- }
net_nfc_util_clear_data(&data);
- }
- else
- {
+ } else {
result = NET_NFC_ALLOC_FAIL;
}
- }
- else
- {
+ } else {
result = NET_NFC_NO_NDEF_MESSAGE;
}
fclose(fp);
- }
- else
- {
+ } else {
result = NET_NFC_NO_NDEF_MESSAGE;
}
ndef_record_s *struct_record = (ndef_record_s *)record;
if (record == NULL || payload == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*payload = (data_h)&(struct_record->payload_s);
ndef_record_s *struct_record = (ndef_record_s *)record;
if (record == NULL || type == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*type = (data_h)&(struct_record->type_s);
ndef_record_s *struct_record = (ndef_record_s *)record;
if (record == NULL || id == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*id = (data_h)&(struct_record->id_s);
ndef_record_s *struct_record = (ndef_record_s *)record;
if (record == NULL || TNF == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*TNF = (net_nfc_record_tnf_e)struct_record->TNF;
data_s *tmp_id = (data_s *)id;
if (record == NULL || tmp_id == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
return net_nfc_util_set_record_id((ndef_record_s *)record,
tmp_id->buffer, tmp_id->length);
ndef_record_s *struct_record = (ndef_record_s *)record;
if (record == NULL || flag == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*flag = struct_record->MB;
*flag <<= 1;
data_h payload;
if (record == NULL || buffer == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*buffer = NULL;
- if (_is_text_record(record) == false)
- {
+ if (_is_text_record(record) == false) {
DEBUG_ERR_MSG("record type is not matched");
return NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE;
}
result = net_nfc_get_record_payload(record, &payload);
- if (result == NET_NFC_OK)
- {
+ if (result == NET_NFC_OK) {
uint8_t *buffer_temp = net_nfc_get_data_buffer(payload);
uint32_t buffer_length = net_nfc_get_data_length(payload);
char *temp = NULL;
_net_nfc_util_alloc_mem(temp, text_length + 1);
- if (temp != NULL)
- {
+ if (temp != NULL) {
memcpy(temp, &(buffer_temp[index]), text_length);
DEBUG_CLIENT_MSG("text = [%s]", temp);
*buffer = temp;
- }
- else
- {
+ } else {
result = NET_NFC_ALLOC_FAIL;
}
}
data_h payload;
if (record == NULL || lang_code_str == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*lang_code_str = NULL;
- if (_is_text_record(record) == false)
- {
+ if (_is_text_record(record) == false) {
DEBUG_ERR_MSG("record type is not matched");
return NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE;
}
result = net_nfc_get_record_payload(record, &payload);
- if (result == NET_NFC_OK)
- {
+ if (result == NET_NFC_OK) {
uint8_t *buffer_temp = net_nfc_get_data_buffer(payload);
char *buffer = NULL;
int index = 1;
_net_nfc_util_alloc_mem(buffer, lang_code_length + 1);
- if (buffer != NULL)
- {
+ if (buffer != NULL) {
memcpy(buffer, &(buffer_temp[index]), lang_code_length);
DEBUG_CLIENT_MSG("language code = [%s]", buffer);
*lang_code_str = buffer;
- }
- else
- {
+ } else {
result = NET_NFC_ALLOC_FAIL;
}
}
data_h payload;
if (record == NULL || encoding == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*encoding = NET_NFC_ENCODE_UTF_8;
- if (_is_text_record(record) == false)
- {
+ if (_is_text_record(record) == false) {
DEBUG_ERR_MSG("record type is not matched");
return NET_NFC_NDEF_RECORD_IS_NOT_EXPECTED_TYPE;
}
result = net_nfc_get_record_payload(record, &payload);
- if (result == NET_NFC_OK)
- {
+ if (result == NET_NFC_OK) {
uint8_t *buffer_temp = net_nfc_get_data_buffer(payload);
int controllbyte = buffer_temp[0];
if ((controllbyte & 0x80) == 0x80)
- {
*encoding = NET_NFC_ENCODE_UTF_16;
- }
}
return result;
typedef struct _P2p_SignalHandler P2pSignalHandler;
-struct _P2p_SignalHandler
-{
+struct _P2p_SignalHandler {
net_nfc_client_p2p_device_discovered p2p_device_discovered_cb;
net_nfc_client_p2p_device_detached p2p_device_detached_cb;
net_nfc_client_p2p_data_received p2p_data_received_cb;
/*llcp client function to set/unset the current target id needs to be implemented*/
/*net_nfc_client_llcp_current_target_id(NULL);*/
- if (p2p_signal_handler.p2p_device_detached_cb)
- {
+ if (p2p_signal_handler.p2p_device_detached_cb) {
p2p_signal_handler.p2p_device_detached_cb(
p2p_signal_handler.p2p_device_detached_data);
}
handle_info = GUINT_TO_POINTER(arg_handle);
- if (p2p_signal_handler.p2p_device_discovered_cb)
- {
+ if (p2p_signal_handler.p2p_device_discovered_cb) {
p2p_signal_handler.p2p_device_discovered_cb(handle_info,
p2p_signal_handler.p2p_device_discovered_data);
}
{
INFO_MSG(">>> SIGNAL arrived");
- if (p2p_signal_handler.p2p_data_received_cb)
- {
+ if (p2p_signal_handler.p2p_data_received_cb) {
data_s p2p_data = { NULL, };
net_nfc_util_gdbus_variant_to_data_s(arg_data, &p2p_data);
NET_NFC_GDBUS_P2P(source_object),
(gint *)&out_result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish p2p send: %s", error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_p2p_send_completed callback =
(net_nfc_client_p2p_send_completed)func_data->callback;
GVariant *arg_data;
NetNfcCallback *func_data;
- if (p2p_proxy == NULL)
- {
+ if (p2p_proxy == NULL) {
DEBUG_ERR_MSG("Can not get P2pProxy");
return NET_NFC_NOT_INITIALIZED;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(NetNfcCallback, 1);
- if (func_data == NULL) {
+ if (func_data == NULL)
return NET_NFC_ALLOC_FAIL;
- }
func_data->callback = (gpointer)callback;
func_data->user_data = user_data;
net_nfc_error_e out_result;
- if (p2p_proxy == NULL)
- {
+ if (p2p_proxy == NULL) {
DEBUG_ERR_MSG("Can not get P2pProxy");
return NET_NFC_NOT_INITIALIZED;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
arg_data = net_nfc_util_gdbus_data_to_variant(data);
GPOINTER_TO_UINT(handle),
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("p2p send (sync call) failed: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
if (callback == NULL)
return;
- if (p2p_proxy == NULL)
- {
- if (net_nfc_client_p2p_init() != NET_NFC_OK)
- {
+ if (p2p_proxy == NULL) {
+ if (net_nfc_client_p2p_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("P2pProxy fail");
/* FIXME : return result of this error */
return;
if (callback == NULL)
return;
- if (p2p_proxy == NULL)
- {
- if (net_nfc_client_p2p_init() != NET_NFC_OK)
- {
+ if (p2p_proxy == NULL) {
+ if (net_nfc_client_p2p_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("P2pProxy fail");
/* FIXME : return result of this error */
return;
if (callback == NULL)
return;
- if (p2p_proxy == NULL)
- {
- if (net_nfc_client_p2p_init() != NET_NFC_OK)
- {
+ if (p2p_proxy == NULL) {
+ if (net_nfc_client_p2p_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("P2pProxy fail");
/* FIXME : return result of this error */
return;
{
GError *error = NULL;
- if (p2p_proxy)
- {
+ if (p2p_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/P2p",
NULL,
&error);
- if (p2p_proxy == NULL)
- {
+ if (p2p_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_p2p_deinit(void)
{
- if (p2p_proxy)
- {
+ if (p2p_proxy) {
g_object_unref(p2p_proxy);
p2p_proxy = NULL;
}
typedef struct _SeFuncData SeFuncData;
-struct _SeFuncData
-{
+struct _SeFuncData {
gpointer se_callback;
gpointer se_data;
};
typedef struct _SeEventHandler SeEventHandler;
-struct _SeEventHandler
-{
+struct _SeEventHandler {
net_nfc_client_se_event se_event_cb;
gpointer se_event_data;
};
typedef struct _SeTransEventHandler SeTransEventHandler;
-struct _SeTransEventHandler
-{
+struct _SeTransEventHandler {
net_nfc_client_se_transaction_event transaction_event_cb;
gpointer transaction_event_data;
};
typedef struct _SeESEDetectedHandler SeESEDetectedHandler;
-struct _SeESEDetectedHandler
-{
+struct _SeESEDetectedHandler {
net_nfc_client_se_ese_detected_event se_ese_detected_cb;
gpointer se_ese_detected_data;
};
INFO_MSG(">>> SIGNAL arrived");
- if (se_eventhandler.se_event_cb != NULL)
- {
+ if (se_eventhandler.se_event_cb != NULL) {
net_nfc_client_se_event callback =
(net_nfc_client_se_event)se_eventhandler.se_event_cb;
{
INFO_MSG(">>> SIGNAL arrived");
- if (se_eventhandler.se_event_cb != NULL)
- {
+ if (se_eventhandler.se_event_cb != NULL) {
net_nfc_client_se_event callback =
(net_nfc_client_se_event)se_eventhandler.se_event_cb;
return;
}
#endif
- switch (arg_se_type)
- {
- case NET_NFC_SE_TYPE_UICC :
- if (uicc_transactionEventHandler.transaction_event_cb != NULL)
- {
+ switch (arg_se_type) {
+ case NET_NFC_SE_TYPE_UICC:
+ if (uicc_transactionEventHandler.transaction_event_cb != NULL) {
callback = uicc_transactionEventHandler.transaction_event_cb;
user_data = uicc_transactionEventHandler.transaction_event_data;
}
break;
- case NET_NFC_SE_TYPE_ESE :
- if (ese_transactionEventHandler.transaction_event_cb != NULL)
- {
+ case NET_NFC_SE_TYPE_ESE:
+ if (ese_transactionEventHandler.transaction_event_cb != NULL) {
callback = ese_transactionEventHandler.transaction_event_cb;
user_data = ese_transactionEventHandler.transaction_event_data;
}
break;
- default :
+ default:
DEBUG_ERR_MSG("Transaction event SE type wrong [%d]", arg_se_type);
break;
}
{
INFO_MSG(">>> SIGNAL arrived");
- if (se_eventhandler.se_event_cb != NULL)
- {
+ if (se_eventhandler.se_event_cb != NULL) {
net_nfc_client_se_event callback =
(net_nfc_client_se_event)se_eventhandler.se_event_cb;
if (net_nfc_gdbus_secure_element_call_set_finish(se_proxy,
&result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Could not set secure element: %s",
error->message);
g_error_free(error);
}
- if (func_data->se_callback != NULL)
- {
+ if (func_data->se_callback != NULL) {
net_nfc_se_set_se_cb se_callback =
(net_nfc_se_set_se_cb)func_data->se_callback;
&result,
&out_handle,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Could not open secure element: %s",
error->message);
g_error_free(error);
}
- if (func_data->se_callback != NULL)
- {
+ if (func_data->se_callback != NULL) {
net_nfc_se_open_se_cb se_callback =
(net_nfc_se_open_se_cb)func_data->se_callback;
se_proxy,
&result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Could not close secure element: %s", error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->se_callback != NULL)
- {
+ if (func_data->se_callback != NULL) {
net_nfc_se_close_se_cb se_callback =
(net_nfc_se_close_se_cb)func_data->se_callback;
&result,
&out_response,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Could not send apdu: %s", error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->se_callback != NULL)
- {
+ if (func_data->se_callback != NULL) {
net_nfc_se_send_apdu_cb se_callback =
(net_nfc_se_send_apdu_cb)func_data->se_callback;
data_s data = { NULL, };
&result,
&out_atr,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Could not get atr: %s", error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->se_callback != NULL)
- {
+ if (func_data->se_callback != NULL) {
net_nfc_se_get_atr_cb se_callback =
(net_nfc_se_get_atr_cb)func_data->se_callback;
data_s data = { NULL, };
{
SeFuncData *func_data;
- if (se_proxy == NULL)
- {
- if (net_nfc_client_se_init() != NET_NFC_OK)
- {
+ if (se_proxy == NULL) {
+ if (net_nfc_client_se_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("se_proxy fail");
/* FIXME : return result of this error */
return NET_NFC_NOT_INITIALIZED;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(SeFuncData, 1);
if (func_data == NULL)
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (se_proxy == NULL)
- {
- if (net_nfc_client_se_init() != NET_NFC_OK)
- {
+ if (se_proxy == NULL) {
+ if (net_nfc_client_se_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("se_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_secure_element_call_set_sync(
se_proxy,
(gint)se_type,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Set secure element failed: %s", error->message);
result = NET_NFC_IPC_FAIL;
#if 1
GError *error = NULL;
#endif
- if (se_proxy == NULL)
- {
- if (net_nfc_client_se_init() != NET_NFC_OK)
- {
+ if (se_proxy == NULL) {
+ if (net_nfc_client_se_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("se_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
#if 0
- if (vconf_get_int(VCONFKEY_NFC_SE_TYPE, &type) == 0) {
+ if (vconf_get_int(VCONFKEY_NFC_SE_TYPE, &type) == 0)
*se_type = type;
- } else {
+ else
result = NET_NFC_OPERATION_FAIL;
- }
#else
if (net_nfc_gdbus_secure_element_call_get_sync(
se_proxy,
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (se_proxy == NULL)
- {
- if (net_nfc_client_se_init() != NET_NFC_OK)
- {
+ if (se_proxy == NULL) {
+ if (net_nfc_client_se_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("se_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_secure_element_call_set_card_emulation_sync(
se_proxy,
(gint)mode,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Set card emulation failed: %s", error->message);
result = NET_NFC_IPC_FAIL;
gint type;
GError *error = NULL;
- if (se_proxy == NULL)
- {
- if (net_nfc_client_se_init() != NET_NFC_OK)
- {
+ if (se_proxy == NULL) {
+ if (net_nfc_client_se_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("se_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_secure_element_call_get_card_emulation_sync(
se_proxy,
{
SeFuncData *func_data;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
guint out_handle = 0;
GError *error = NULL;
- if (handle == NULL) {
+ if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- }
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
{
SeFuncData *func_data;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
GPOINTER_TO_UINT(handle),
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("close internal secure element failed: %s",
error->message);
result = NET_NFC_IPC_FAIL;
{
SeFuncData *func_data;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
GVariant *out_atr = NULL;
GError *error = NULL;
- if (atr == NULL) {
+ if (atr == NULL)
return NET_NFC_NULL_PARAMETER;
- }
*atr = NULL;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
SeFuncData *func_data;
GVariant *arg_data;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
GError *error = NULL;
GVariant *arg_data;
- if (response == NULL) {
+ if (response == NULL)
return NET_NFC_NULL_PARAMETER;
- }
*response = NULL;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
net_nfc_client_se_ese_detected_event callback,
void *user_data)
{
- if (se_proxy == NULL)
- {
- if (net_nfc_client_se_init() != NET_NFC_OK)
- {
+ if (se_proxy == NULL) {
+ if (net_nfc_client_se_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("se_proxy fail");
/* FIXME : return result of this error */
return;
net_nfc_client_se_transaction_event callback,
void *user_data)
{
- if (se_proxy == NULL)
- {
- if (net_nfc_client_se_init() != NET_NFC_OK)
- {
+ if (se_proxy == NULL) {
+ if (net_nfc_client_se_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("se_proxy fail");
/* FIXME : return result of this error */
return;
}
}
- if (se_type == NET_NFC_SE_TYPE_ESE)
- {
+ if (se_type == NET_NFC_SE_TYPE_ESE) {
ese_transactionEventHandler.transaction_event_cb = callback;
ese_transactionEventHandler.transaction_event_data = user_data;
- }
- else if (se_type == NET_NFC_SE_TYPE_UICC)
- {
+ } else if (se_type == NET_NFC_SE_TYPE_UICC) {
uicc_transactionEventHandler.transaction_event_cb = callback;
uicc_transactionEventHandler.transaction_event_data = user_data;
}
NET_NFC_EXPORT_API
void net_nfc_client_se_unset_transaction_event_cb(net_nfc_se_type_e type)
{
- if (type == NET_NFC_SE_TYPE_ESE)
- {
+ if (type == NET_NFC_SE_TYPE_ESE) {
ese_transactionEventHandler.transaction_event_cb = NULL;
ese_transactionEventHandler.transaction_event_data = NULL;
- }
- else if (type == NET_NFC_SE_TYPE_UICC)
- {
+ } else if (type == NET_NFC_SE_TYPE_UICC) {
uicc_transactionEventHandler.transaction_event_cb = NULL;
uicc_transactionEventHandler.transaction_event_data = NULL;
}
void net_nfc_client_se_set_event_cb(net_nfc_client_se_event callback,
void *user_data)
{
- if (se_proxy == NULL)
- {
- if (net_nfc_client_se_init() != NET_NFC_OK)
- {
+ if (se_proxy == NULL) {
+ if (net_nfc_client_se_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("se_proxy fail");
/* FIXME : return result of this error */
return;
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (se_proxy == NULL)
- {
+ if (se_proxy == NULL) {
result = net_nfc_client_se_init();
- if (result != NET_NFC_OK)
- {
+ if (result != NET_NFC_OK) {
DEBUG_ERR_MSG("net_nfc_client_se_init failed, [%d]", result);
return NET_NFC_NOT_INITIALIZED;
battery_off,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Set Route Aid failed: %s", error->message);
result = NET_NFC_IPC_FAIL;
GError *error = NULL;
gboolean ret = false;
- if (activated == NULL) {
+ if (activated == NULL)
return NET_NFC_NULL_PARAMETER;
- }
if (se_proxy == NULL) {
result = net_nfc_client_se_init();
GError *error = NULL;
gboolean ret = false;
- if (activated == NULL) {
+ if (activated == NULL)
return NET_NFC_NULL_PARAMETER;
- }
if (se_proxy == NULL) {
result = net_nfc_client_se_init();
GError *error = NULL;
GVariant *aids = NULL;
- if (count == NULL) {
+ if (count == NULL)
return NET_NFC_NULL_PARAMETER;
- }
if (se_proxy == NULL) {
result = net_nfc_client_se_init();
&result,
&aids,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("net_nfc_gdbus_secure_element_call_get_registered_aids_sync failed : %s", error->message);
result = NET_NFC_IPC_FAIL;
GError *error = NULL;
GVariant *aids = NULL;
- if (callback == NULL) {
+ if (callback == NULL)
return NET_NFC_NULL_PARAMETER;
- }
if (se_proxy == NULL) {
result = net_nfc_client_se_init();
&result,
&aids,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("net_nfc_gdbus_secure_element_call_get_registered_aids_sync failed : %s", error->message);
result = NET_NFC_IPC_FAIL;
g_variant_iter_init(&iter, aids);
- while (g_variant_iter_loop(&iter, "(sb)", &aid, &manifest) == true) {
+ while (g_variant_iter_loop(&iter, "(sb)", &aid, &manifest) == true)
callback(se_type, aid, (bool)manifest, user_data);
- }
}
return result;
aid,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("net_nfc_gdbus_secure_element_call_register_aid_sync failed : %s", error->message);
result = NET_NFC_IPC_FAIL;
aid,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("net_nfc_gdbus_secure_element_call_unregister_aid_sync failed : %s", error->message);
result = NET_NFC_IPC_FAIL;
category,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("net_nfc_gdbus_secure_element_call_unregister_aids_sync failed : %s", error->message);
result = NET_NFC_IPC_FAIL;
GError *error = NULL;
GVariant *handlers = NULL;
- if (callback == NULL) {
+ if (callback == NULL)
return NET_NFC_NULL_PARAMETER;
- }
if (se_proxy == NULL) {
result = net_nfc_client_se_init();
&result,
&handlers,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("net_nfc_gdbus_secure_element_call_get_registered_handlers_sync failed : %s", error->message);
result = NET_NFC_IPC_FAIL;
g_variant_iter_init(&iter, handlers);
- while (g_variant_iter_loop(&iter, "(is)", &count, &handler) == true) {
+ while (g_variant_iter_loop(&iter, "(is)", &count, &handler) == true)
callback(handler, count, user_data);
- }
}
return result;
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
power,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Set Route Aid failed: %s", error->message);
result = NET_NFC_IPC_FAIL;
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
aid,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Remove Route Aid failed: %s", error->message);
result = NET_NFC_IPC_FAIL;
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
GError *error = NULL;
auto_start_proxy = net_nfc_gdbus_secure_element_proxy_new_for_bus_sync(
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (auto_start_proxy == NULL)
- {
+ if (auto_start_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
package,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Remove Package Aid failed: %s", error->message);
result = NET_NFC_IPC_FAIL;
{
GError *error = NULL;
- if (se_proxy)
- {
+ if (se_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/SecureElement",
NULL,
&error);
- if (se_proxy == NULL)
- {
+ if (se_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_se_deinit(void)
{
- if (se_proxy)
- {
+ if (se_proxy) {
g_object_unref(se_proxy);
se_proxy = NULL;
}
- if (auto_start_proxy)
- {
+ if (auto_start_proxy) {
g_object_unref(auto_start_proxy);
auto_start_proxy = NULL;
}
(guint *)&out_type,
&out_data,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish send client request %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
GError *error = NULL;
GVariant *parameter;
- if (snep_proxy == NULL)
- {
+ if (snep_proxy == NULL) {
DEBUG_ERR_MSG("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
parameter = g_variant_new("(uu)",
GPOINTER_TO_UINT(callback),
GPOINTER_TO_UINT(parameter),
(gint *)&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("snep server(sync call) failed: %s",
error->message);
result = NET_NFC_IPC_FAIL;
GError *error = NULL;
GVariant *parameter;
- if (snep_proxy == NULL)
- {
+ if (snep_proxy == NULL) {
DEBUG_ERR_MSG("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
parameter = g_variant_new("(uu)",
GPOINTER_TO_UINT(callback),
GPOINTER_TO_UINT(parameter),
(gint *)&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("snep client(sync call) failed: %s",
error->message);
result = NET_NFC_IPC_FAIL;
GVariant *parameter;
if (target == NULL || msg == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
- if (snep_proxy == NULL)
- {
+ if (snep_proxy == NULL) {
DEBUG_ERR_MSG("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
parameter = g_variant_new("(uuu)",
GPOINTER_TO_UINT(callback),
if (target == NULL || msg == NULL ||
resp_type == NULL || response == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*response = NULL;
- if (snep_proxy == NULL)
- {
+ if (snep_proxy == NULL) {
DEBUG_ERR_MSG("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
resp_type,
&resp_msg,
NULL,
- &error) == TRUE)
- {
+ &error) == TRUE) {
data_s ndef_data = { NULL, };
net_nfc_util_gdbus_variant_to_data_s(resp_msg, &ndef_data);
- if (ndef_data.buffer != NULL && ndef_data.length > 0)
- {
+ if (ndef_data.buffer != NULL && ndef_data.length > 0) {
result = net_nfc_create_ndef_message_from_rawdata(
response,
&ndef_data);
net_nfc_util_free_data(&ndef_data);
}
- }
- else
- {
+ } else {
DEBUG_ERR_MSG(" send client request (sync call) failed: %s",
error->message);
g_error_free(error);
GError *error = NULL;
if (target == NULL || service == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
- if (snep_proxy == NULL)
- {
+ if (snep_proxy == NULL) {
DEBUG_ERR_MSG("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_snep_call_stop_snep_sync(
snep_proxy,
GPOINTER_TO_UINT(service),
(gint *)&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("snep stop service(sync call) failed: %s",
error->message);
result = NET_NFC_IPC_FAIL;
arg_result,
parameter);
- if (parameter != NULL)
- {
+ if (parameter != NULL) {
net_nfc_client_snep_event_cb callback;
void *user_data;
&callback,
&user_data);
- if (callback != NULL)
- {
+ if (callback != NULL) {
ndef_message_h message;
message = net_nfc_util_gdbus_variant_to_ndef_message(
net_nfc_free_ndef_message(message);
}
#if 0 /* remove temporary... */
- if (arg_event == NET_NFC_LLCP_UNREGISTERED) {
+ if (arg_event == NET_NFC_LLCP_UNREGISTERED)
g_variant_unref(parameter);
- }
#endif
}
}
GError *error = NULL;
GVariant *parameter;
- if (snep_proxy == NULL)
- {
- if(net_nfc_client_snep_init() != NET_NFC_OK)
- {
+ if (snep_proxy == NULL) {
+ if (net_nfc_client_snep_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("Snep Proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
parameter = g_variant_new("(uu)",
GPOINTER_TO_UINT(callback),
GPOINTER_TO_UINT(parameter),
(gint *)&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("snep register server(sync call) failed: %s",
error->message);
result = NET_NFC_IPC_FAIL;
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (snep_proxy == NULL)
- {
+ if (snep_proxy == NULL) {
DEBUG_ERR_MSG("Can not get Snep Proxy");
return NET_NFC_NOT_INITIALIZED;
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_snep_call_server_unregister_sync(snep_proxy,
sap,
san,
(gint *)&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("snep unregister server(sync call) failed: %s",
error->message);
result = NET_NFC_IPC_FAIL;
{
GError *error = NULL;
- if (snep_proxy)
- {
+ if (snep_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/Snep",
NULL,
&error);
- if (snep_proxy == NULL)
- {
+ if (snep_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_snep_deinit(void)
{
- if (snep_proxy)
- {
+ if (snep_proxy) {
g_object_unref(snep_proxy);
snep_proxy = NULL;
}
NET_NFC_GDBUS_POPUP(source_object),
&result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish popup_set_active: %s",
error->message);
result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_popup_set_state_callback callback =
(net_nfc_client_popup_set_state_callback)func_data->callback;
{
NetNfcCallback *func_data;
- if (popup_proxy == NULL)
- {
- if(net_nfc_client_sys_handler_init() != NET_NFC_OK)
- {
+ if (popup_proxy == NULL) {
+ if (net_nfc_client_sys_handler_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("popup_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(NetNfcCallback, 1);
- if (func_data == NULL )
+ if (func_data == NULL)
return NET_NFC_ALLOC_FAIL;
func_data->callback = (gpointer)callback;
net_nfc_error_e result = NET_NFC_OK;
GError *error = NULL;
- if (popup_proxy == NULL)
- {
- if(net_nfc_client_sys_handler_init() != NET_NFC_OK)
- {
+ if (popup_proxy == NULL) {
+ if (net_nfc_client_sys_handler_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("popup_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_popup_call_set_sync(popup_proxy,
state,
CHECK_FOREGROUND,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call SetActive: %s",
error->message);
result = NET_NFC_IPC_FAIL;
{
NetNfcCallback *func_data;
- if (popup_proxy == NULL)
- {
- if(net_nfc_client_sys_handler_init() != NET_NFC_OK)
- {
+ if (popup_proxy == NULL) {
+ if (net_nfc_client_sys_handler_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("popup_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(NetNfcCallback, 1);
if (func_data == NULL)
net_nfc_error_e result;
GError *error = NULL;
- if (popup_proxy == NULL)
- {
- if(net_nfc_client_sys_handler_init() != NET_NFC_OK)
- {
+ if (popup_proxy == NULL) {
+ if (net_nfc_client_sys_handler_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("popup_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_popup_call_set_sync(popup_proxy,
state,
NO_CHECK_FOREGROUND,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call SetActive: %s",
error->message);
result = NET_NFC_IPC_FAIL;
*state = NET_NFC_LAUNCH_APP_SELECT;
if (popup_proxy == NULL) {
- if(net_nfc_client_sys_handler_init() != NET_NFC_OK)
- {
+ if (net_nfc_client_sys_handler_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("popup_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_popup_call_get_sync(popup_proxy,
&result,
{
GError *error = NULL;
- if (popup_proxy)
- {
+ if (popup_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/Popup",
NULL,
&error);
- if (popup_proxy == NULL)
- {
+ if (popup_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_sys_handler_deinit(void)
{
- if (popup_proxy)
- {
+ if (popup_proxy) {
g_object_unref(popup_proxy);
popup_proxy = NULL;
}
DEBUG_CLIENT_MSG("client filter = %d", client_filter);
if (type >= NET_NFC_ISO14443_A_PICC &&
- type <= NET_NFC_MIFARE_DESFIRE_PICC)
- {
+ type <= NET_NFC_MIFARE_DESFIRE_PICC) {
converted = NET_NFC_ISO14443A_ENABLE;
- }
- else if (type >= NET_NFC_ISO14443_B_PICC &&
- type <= NET_NFC_ISO14443_BPRIME_PICC)
- {
+ } else if (type >= NET_NFC_ISO14443_B_PICC &&
+ type <= NET_NFC_ISO14443_BPRIME_PICC) {
converted = NET_NFC_ISO14443B_ENABLE;
- }
- else if (type == NET_NFC_FELICA_PICC)
- {
+ } else if (type == NET_NFC_FELICA_PICC) {
converted = NET_NFC_FELICA_ENABLE;
- }
- else if (type == NET_NFC_JEWEL_PICC)
- {
+ } else if (type == NET_NFC_JEWEL_PICC) {
converted = NET_NFC_FELICA_ENABLE;
- }
- else if (type == NET_NFC_ISO15693_PICC)
- {
+ } else if (type == NET_NFC_ISO15693_PICC) {
converted = NET_NFC_ISO15693_ENABLE;
}
tmp_list = g_new0(net_nfc_tag_info_s, number_of_keys);
current = tmp_list;
- while (i < number_of_keys)
- {
+ while (i < number_of_keys) {
gchar *str = NULL;
data_h value = NULL;
pos++;
value = NULL;
- if (length > 0)
- {
+ if (length > 0) {
net_nfc_create_data(&value, pos, length);
pos += length;
}
&out_is_connected,
(gint32 *)&out_dev_type,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish is_tag_connected: %s",
error->message);
g_error_free(error);
out_result = NET_NFC_IPC_FAIL;
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_tag_is_tag_connected_completed callback =
(net_nfc_client_tag_is_tag_connected_completed)func_data->callback;
g_assert(user_data != NULL);
- if (net_nfc_gdbus_tag_call_get_current_tag_info_finish (
+ if (net_nfc_gdbus_tag_call_get_current_tag_info_finish(
NET_NFC_GDBUS_TAG(source_object),
&out_result,
&out_is_connected,
&out_target_info_values,
&out_raw_data,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
out_result = NET_NFC_IPC_FAIL;
DEBUG_ERR_MSG("Can not finish get_current_tag_info: %s",
}
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_tag_get_current_tag_info_completed callback =
(net_nfc_client_tag_get_current_tag_info_completed)func_data->callback;
(guint *)&out_handle,
(gint *)&out_dev_type,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish get_current_target_handle: %s",
error->message);
g_error_free(error);
out_result = NET_NFC_IPC_FAIL;
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_tag_get_current_target_handle_completed callback =
(net_nfc_client_tag_get_current_target_handle_completed)func_data->callback;
return NET_NFC_NOT_INITIALIZED;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
info = net_nfc_client_tag_get_client_target_info();
if (info == NULL) {
&out_is_connected,
(gint *)&out_dev_type,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not get is_tag_connected result: %s",
error->message);
result = NET_NFC_IPC_FAIL;
}
} else {
/* target was connected */
- if (dev_type != NULL) {
+ if (dev_type != NULL)
*dev_type = info->devType;
- }
result = NET_NFC_OK;
}
return NET_NFC_NOT_INITIALIZED;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_tag_call_get_barcode_sync(tag_proxy,
&result,
&out_barcode,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can no get barcode result: %s", error->message);
result = NET_NFC_IPC_FAIL;
return result;
}
- if(result == NET_NFC_OK)
- {
+ if (result == NET_NFC_OK) {
data = g_new0(data_s, 1);
net_nfc_util_gdbus_variant_to_data_s(out_barcode, data);
- if(data == NULL || data->buffer == NULL || data->length == 0)
+ if (data == NULL || data->buffer == NULL || data->length == 0)
return NET_NFC_OPERATION_FAIL;
- //alloc barcode
+ /* alloc barcode */
*barcode_len = data->length;
*barcode = (unsigned char *)calloc(*barcode_len, sizeof(unsigned char));
memcpy(*barcode, data->buffer, *barcode_len);
- if (data != NULL) {
+ if (data != NULL)
net_nfc_util_free_data(data);
- }
}
return result;
return NET_NFC_NOT_INITIALIZED;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_client_tag_get_client_target_info() == NULL) {
/* try to request target information from server */
&out_target_info_values,
&out_raw_data,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can no get current_tag_info result: %s",
error->message);
result = NET_NFC_IPC_FAIL;
result = NET_NFC_OK;
}
- if (result == NET_NFC_OK && info != NULL) {
+ if (result == NET_NFC_OK && info != NULL)
*info = client_target_info;
- }
return result;
}
return NET_NFC_NOT_INITIALIZED;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
info = net_nfc_client_tag_get_client_target_info();
if (info == NULL) {
&out_handle,
(gint *)&out_dev_type,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can no get current_target_handle result: %s",
error->message);
result = NET_NFC_IPC_FAIL;
if (callback == NULL)
return;
- if (tag_proxy == NULL)
- {
- if (net_nfc_client_tag_init() != NET_NFC_OK)
- {
+ if (tag_proxy == NULL) {
+ if (net_nfc_client_tag_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
/* FIXME : return result of this error */
return;
if (callback == NULL)
return;
- if (tag_proxy == NULL)
- {
- if (net_nfc_client_tag_init() != NET_NFC_OK)
- {
+ if (tag_proxy == NULL) {
+ if (net_nfc_client_tag_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("tag_proxy fail");
/* FIXME : return result of this error */
return;
{
GError *error = NULL;
- if (tag_proxy)
- {
+ if (tag_proxy) {
DEBUG_CLIENT_MSG("Alrady initialized");
return NET_NFC_OK;
}
- if (client_target_info)
- {
+ if (client_target_info) {
net_nfc_release_tag_info(
(net_nfc_target_info_h)client_target_info);
client_target_info = NULL;
"/org/tizen/NetNfcService/Tag",
NULL,
&error);
- if (tag_proxy == NULL)
- {
+ if (tag_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
net_nfc_client_tag_unset_tag_discovered();
net_nfc_client_tag_unset_tag_detached();
- if (tag_proxy)
- {
+ if (tag_proxy) {
g_object_unref(tag_proxy);
tag_proxy = NULL;
}
if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if (target_info->devType != NET_NFC_FELICA_PICC)
- {
+ if (target_info->devType != NET_NFC_FELICA_PICC) {
DEBUG_CLIENT_MSG("only felica tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
if (handle == NULL || area_service_list == NULL)
return NET_NFC_NULL_PARAMETER;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if (target_info->devType != NET_NFC_FELICA_PICC)
- {
+ if (target_info->devType != NET_NFC_FELICA_PICC) {
DEBUG_CLIENT_MSG("only felica tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
FELICA_TAG_KEY,
- &IDm) != NET_NFC_OK)
- {
+ &IDm) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
*send_buffer = number_of_area_service;
send_buffer++;
- for (i = 0; i < number_of_services; i++)
- {
+ for (i = 0; i < number_of_services; i++) {
memcpy(send_buffer, &area_service_list[i], sizeof(uint16_t));
send_buffer = send_buffer + 2;
}
if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if (target_info->devType != NET_NFC_FELICA_PICC)
- {
+ if (target_info->devType != NET_NFC_FELICA_PICC) {
DEBUG_CLIENT_MSG("only felica tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
FELICA_TAG_KEY,
- &IDm) != NET_NFC_OK)
- {
+ &IDm) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
if (handle == NULL || service_list == NULL || block_list == NULL)
return NET_NFC_NULL_PARAMETER;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if (target_info->devType != NET_NFC_FELICA_PICC)
- {
+ if (target_info->devType != NET_NFC_FELICA_PICC) {
DEBUG_CLIENT_MSG("only felica tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
FELICA_TAG_KEY,
- &IDm) != NET_NFC_OK)
- {
+ &IDm) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
*send_buffer = number_of_services;
send_buffer++;
- for (i = 0; i < number_of_services; i++)
- {
+ for (i = 0; i < number_of_services; i++) {
memcpy(send_buffer, &service_list[i], sizeof(uint16_t));
send_buffer = send_buffer + 2;
}
*send_buffer = number_of_blocks;
send_buffer++;
- for (i = 0; i < number_of_blocks; i++)
- {
+ for (i = 0; i < number_of_blocks; i++) {
memcpy(send_buffer, &block_list[i], sizeof(uint8_t));
send_buffer++;
}
int i;
if (handle == NULL || service_list == NULL ||
- block_list == NULL || data == NULL)
- {
+ block_list == NULL || data == NULL) {
return NET_NFC_NULL_PARAMETER;
}
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if (target_info->devType != NET_NFC_FELICA_PICC)
- {
+ if (target_info->devType != NET_NFC_FELICA_PICC) {
DEBUG_CLIENT_MSG("only felica tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
FELICA_TAG_KEY,
- &IDm) != NET_NFC_OK)
- {
+ &IDm) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
*send_buffer = number_of_services;
send_buffer++;
- for (i = 0; i < number_of_services; i++)
- {
+ for (i = 0; i < number_of_services; i++) {
memcpy(send_buffer, &service_list[i], sizeof(uint16_t));
send_buffer = send_buffer + 2;
}
*send_buffer = number_of_blocks;
send_buffer++;
- for (i = 0; i < number_of_blocks; i++)
- {
+ for (i = 0; i < number_of_blocks; i++) {
memcpy(send_buffer, &block_list[i], sizeof(uint8_t));
send_buffer++;
}
if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if (target_info->devType != NET_NFC_FELICA_PICC)
- {
+ if (target_info->devType != NET_NFC_FELICA_PICC) {
DEBUG_CLIENT_MSG("only felica tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
FELICA_TAG_KEY,
- &IDm) != NET_NFC_OK)
- {
+ &IDm) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
uint8_t send_buffer[9] = {0x00, };
- if(handle == NULL)
+ if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if(target_info->devType != NET_NFC_JEWEL_PICC)
- {
+ if (target_info->devType != NET_NFC_JEWEL_PICC) {
DEBUG_CLIENT_MSG("only Jewel tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
uint8_t send_buffer[9] = {0x00, };
- if(handle == NULL)
+ if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if(block > 0xE || byte > 0x7 )
+ if (block > 0xE || byte > 0x7)
return NET_NFC_OUT_OF_BOUND;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if(target_info->devType != NET_NFC_JEWEL_PICC)
- {
+ if (target_info->devType != NET_NFC_JEWEL_PICC) {
DEBUG_CLIENT_MSG("only Jewel tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
- if(net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
+ if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
JEWEL_TAG_KEY,
- &UID) != NET_NFC_OK)
- {
+ &UID) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
- if(((data_s*)UID)->length != 4)
+ if (((data_s*)UID)->length != 4)
return NET_NFC_OUT_OF_BOUND;
/* command */
uint8_t send_buffer[9] = {0x00, };
- if(handle == NULL )
+ if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if(target_info->devType != NET_NFC_JEWEL_PICC)
- {
+ if (target_info->devType != NET_NFC_JEWEL_PICC) {
DEBUG_CLIENT_MSG("only Jewel tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
- if(net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
+ if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
JEWEL_TAG_KEY,
- &UID) != NET_NFC_OK)
- {
+ &UID) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
- if(((data_s*)UID)->length != 4)
+ if (((data_s*)UID)->length != 4)
return NET_NFC_OUT_OF_BOUND;
/* command */
uint8_t send_buffer[9] = {0x00, };
- if(handle == NULL)
+ if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if(block > 0xE || byte > 0x7 )
+ if (block > 0xE || byte > 0x7)
return NET_NFC_OUT_OF_BOUND;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
-
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if(net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
+ if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
JEWEL_TAG_KEY,
- &UID) != NET_NFC_OK)
- {
+ &UID) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
- if(((data_s*)UID)->length != 4)
+ if (((data_s*)UID)->length != 4)
return NET_NFC_OUT_OF_BOUND;
/* command */
uint8_t send_buffer[9] = {0x00, };
- if(handle == NULL)
+ if (handle == NULL)
return NET_NFC_NULL_PARAMETER;
- if(block > 0xE || byte > 0x7 )
+ if (block > 0xE || byte > 0x7)
return NET_NFC_OUT_OF_BOUND;
- if(net_nfc_client_tag_is_connected() == FALSE)
+ if (net_nfc_client_tag_is_connected() == FALSE)
return NET_NFC_OPERATION_FAIL;
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL)
return NET_NFC_NO_DATA_FOUND;
- if(target_info->devType != NET_NFC_JEWEL_PICC)
- {
+ if (target_info->devType != NET_NFC_JEWEL_PICC) {
DEBUG_CLIENT_MSG("only Jewel tag is available");
return NET_NFC_NOT_ALLOWED_OPERATION;
}
- if(net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
+ if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
JEWEL_TAG_KEY,
- &UID) != NET_NFC_OK)
- {
+ &UID) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
- if(((data_s*)UID)->length != 4)
+ if (((data_s*)UID)->length != 4)
return NET_NFC_OUT_OF_BOUND;
/* command */
target_info = net_nfc_client_tag_get_client_target_info();
- if (target_info)
- {
+ if (target_info) {
if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
- target_info->devType > NET_NFC_MIFARE_4K_PICC)
- {
+ target_info->devType > NET_NFC_MIFARE_4K_PICC) {
DEBUG_CLIENT_MSG("not a MIFARE Classic TAG");
return NET_NFC_NOT_SUPPORTED;
}
if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
MIFARE_TAG_KEY,
- &UID) != NET_NFC_OK)
- {
+ &UID) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
- switch (target_info->devType)
- {
- case NET_NFC_MIFARE_MINI_PICC :
+ switch (target_info->devType) {
+ case NET_NFC_MIFARE_MINI_PICC:
{
/* 0 ~ 4 : 5 sector and 4 block with 16 bytes */
if (sector > MIFARE_MINI_SECTORS - 1)
sector_to_block = sector * MIFARE_BLOCK_4 + 3;
}
break;
- case NET_NFC_MIFARE_1K_PICC :
+ case NET_NFC_MIFARE_1K_PICC:
{
/* 0 ~ 15 : 16 sector and 4 block with 16 bytes */
if (sector > MIFARE_1K_SECTORS)
sector_to_block = sector * MIFARE_BLOCK_4 + 3;
}
break;
- case NET_NFC_MIFARE_4K_PICC :
+ case NET_NFC_MIFARE_4K_PICC:
{
/* 0 ~ 31 : 32 sector and 4 block with 16 bytes
* 32 ~ 39 : 8 sector and 16 block with 16 bytes
if (sector < 32)
sector_to_block = sector * MIFARE_BLOCK_4 + 3;
- else
- {
+ else {
sector_to_block = (31 * MIFARE_BLOCK_4 + 3)
+ (sector - 32)
* MIFARE_BLOCK_16 + 15;
}
}
break;
- default :
+ default:
break;
}
_net_nfc_util_alloc_mem(send_buffer,
send_buffer_length * sizeof(uint8_t));
- if (send_buffer == NULL)
- {
+ if (send_buffer == NULL) {
net_nfc_free_data(UID);
return NET_NFC_ALLOC_FAIL;
}
target_info = net_nfc_client_tag_get_client_target_info();
- if (target_info != NULL)
- {
+ if (target_info != NULL) {
if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
- target_info->devType > NET_NFC_MIFARE_4K_PICC)
- {
+ target_info->devType > NET_NFC_MIFARE_4K_PICC) {
DEBUG_CLIENT_MSG("not a MIFARE Classic TAG");
return NET_NFC_NOT_SUPPORTED;
}
if (net_nfc_get_tag_info_value((net_nfc_target_info_h)target_info,
MIFARE_TAG_KEY,
- &UID) != NET_NFC_OK)
- {
+ &UID) != NET_NFC_OK) {
return NET_NFC_NO_DATA_FOUND;
}
- switch (target_info->devType)
- {
- case NET_NFC_MIFARE_MINI_PICC :
+ switch (target_info->devType) {
+ case NET_NFC_MIFARE_MINI_PICC:
{
/* 0 ~ 4 : 5 sector and 4 block with 16 bytes */
if (sector > MIFARE_MINI_SECTORS)
sector_to_block = sector * MIFARE_BLOCK_4 + 3;
}
break;
- case NET_NFC_MIFARE_1K_PICC :
+ case NET_NFC_MIFARE_1K_PICC:
{
/* 0 ~ 15 : 16 sector and 4 block with 16 bytes */
if (sector > MIFARE_1K_SECTORS)
sector_to_block = sector * MIFARE_BLOCK_4 + 3;
}
break;
- case NET_NFC_MIFARE_4K_PICC :
+ case NET_NFC_MIFARE_4K_PICC:
{
/* 0 ~ 31 : 32 sector and 4 block with 16 bytes
* 32 ~ 39 : 8 sector and 16 block with 16 bytes
if (sector < 32)
sector_to_block = sector * MIFARE_BLOCK_4 + 3;
- else
- {
+ else {
sector_to_block = (31 * MIFARE_BLOCK_4 + 3)
+ (sector - 32)
* MIFARE_BLOCK_16 + 15;
}
}
break;
- default :
+ default:
break;
}
_net_nfc_util_alloc_mem(send_buffer, send_buffer_length
* sizeof(uint8_t));
- if (send_buffer == NULL)
- {
+ if (send_buffer == NULL) {
net_nfc_free_data(UID);
return NET_NFC_ALLOC_FAIL;
}
target_info = net_nfc_client_tag_get_client_target_info();
- if (target_info != NULL)
- {
+ if (target_info != NULL) {
if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
- target_info->devType > NET_NFC_MIFARE_ULTRA_PICC)
- {
+ target_info->devType > NET_NFC_MIFARE_ULTRA_PICC) {
DEBUG_CLIENT_MSG("not a MIFARE TAG = [%d]",
target_info->devType);
return NET_NFC_NOT_SUPPORTED;
}
- if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC)
- {
+ if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC) {
if (addr > 7)
return NET_NFC_OUT_OF_BOUND;
}
return NET_NFC_NOT_INITIALIZED;
if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
- target_info->devType > NET_NFC_MIFARE_ULTRA_PICC)
- {
+ target_info->devType > NET_NFC_MIFARE_ULTRA_PICC) {
DEBUG_CLIENT_MSG("not a MIFARE TAG = [%d] ",
target_info->devType);
return NET_NFC_NOT_SUPPORTED;
}
- if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC)
- {
+ if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC) {
if (addr > 7)
return NET_NFC_OUT_OF_BOUND;
}
- if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC)
- {
- if (((data_s *)data)->length > MIFARE_PAGE_SIZE)
- {
+ if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC) {
+ if (((data_s *)data)->length > MIFARE_PAGE_SIZE) {
uint8_t* temp = NULL;
/* cmd + addr + page */
((data_s*)data)->buffer,
MIFARE_PAGE_SIZE);
- }
- else
- {
+ } else {
uint8_t* temp = NULL;
/* cmd + addr + page */
((data_s*)data)->length);
}
- }
- else
- {
-
- if (((data_s*)data)->length > MIFARE_BLOCK_SIZE)
- {
+ } else {
+ if (((data_s*)data)->length > MIFARE_BLOCK_SIZE) {
uint8_t* temp = NULL;
/* cmd + addr + page*/
memcpy(temp,
((data_s*)data)->buffer,
MIFARE_BLOCK_SIZE);
- }
- else
- {
+ } else {
uint8_t* temp = NULL;
/* cmd + addr + page */
return NET_NFC_NOT_INITIALIZED;
if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
- target_info->devType > NET_NFC_MIFARE_ULTRA_PICC)
- {
+ target_info->devType > NET_NFC_MIFARE_ULTRA_PICC) {
DEBUG_CLIENT_MSG("not a MIFARE TAG = [%d] ",
target_info->devType);
return NET_NFC_NOT_SUPPORTED;
}
- if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC)
- {
+ if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC) {
if (addr > 7)
return NET_NFC_OUT_OF_BOUND;
}
- if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC)
- {
- if (((data_s*)data)->length > MIFARE_PAGE_SIZE)
- {
+ if (target_info->devType == NET_NFC_MIFARE_ULTRA_PICC) {
+ if (((data_s*)data)->length > MIFARE_PAGE_SIZE) {
uint8_t* temp = NULL;
/* cmd + addr + page */
memcpy(temp,
((data_s*)data)->buffer,
MIFARE_PAGE_SIZE);
- }
- else
- {
+ } else {
uint8_t* temp = NULL;
/* cmd + addr + page */
((data_s*)data)->length);
}
- }
- else
- {
- if (((data_s*)data)->length > MIFARE_PAGE_SIZE)
- {
+ } else {
+ if (((data_s*)data)->length > MIFARE_PAGE_SIZE) {
uint8_t* temp = NULL;
/* cmd + addr + page */
((data_s*)data)->buffer,
MIFARE_PAGE_SIZE);
- }
- else
- {
+ } else {
uint8_t* temp = NULL;
/* cmd + addr + page */
target_info = net_nfc_client_tag_get_client_target_info();
- if (target_info)
- {
+ if (target_info) {
if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
- target_info->devType > NET_NFC_MIFARE_4K_PICC)
- {
+ target_info->devType > NET_NFC_MIFARE_4K_PICC) {
DEBUG_CLIENT_MSG(
"not a MIFARE Classic TAG = [%d]",
target_info->devType);
target_info = net_nfc_client_tag_get_client_target_info();
- if (target_info)
- {
+ if (target_info) {
if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
- target_info->devType > NET_NFC_MIFARE_4K_PICC)
- {
+ target_info->devType > NET_NFC_MIFARE_4K_PICC) {
DEBUG_CLIENT_MSG("not a MIFARE Classic TAG = [%d] ",
target_info->devType);
return NET_NFC_NOT_SUPPORTED;
target_info = net_nfc_client_tag_get_client_target_info();
- if (target_info)
- {
+ if (target_info) {
if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
- target_info->devType > NET_NFC_MIFARE_4K_PICC)
- {
+ target_info->devType > NET_NFC_MIFARE_4K_PICC) {
DEBUG_CLIENT_MSG("not a MIFARE Classic TAG = [%d]",
target_info->devType);
return NET_NFC_NOT_SUPPORTED;
target_info = net_nfc_client_tag_get_client_target_info();
- if (target_info)
- {
+ if (target_info) {
if (target_info->devType < NET_NFC_MIFARE_MINI_PICC ||
- target_info->devType > NET_NFC_MIFARE_4K_PICC)
- {
+ target_info->devType > NET_NFC_MIFARE_4K_PICC) {
DEBUG_CLIENT_MSG("not a MIFARE Classic TAG = [%d]",
target_info->devType);
return NET_NFC_NOT_SUPPORTED;
(net_nfc_target_info_s *)target_info;
if (type == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*type = NET_NFC_UNKNOWN_TARGET;
if (target_info == NULL)
- {
return NET_NFC_INVALID_HANDLE;
- }
*type = target_info_private->devType;
(net_nfc_target_info_s *)target_info;
if (handle == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*handle = NULL;
if (target_info == NULL)
- {
return NET_NFC_INVALID_HANDLE;
- }
*handle = (net_nfc_target_handle_h)target_info_private->handle;
(net_nfc_target_info_s *)target_info;
if (target_info == NULL || is_support == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*is_support = (bool)target_info_private->is_ndef_supported;
(net_nfc_target_info_s *)target_info;
if (target_info == NULL || state == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*state = (net_nfc_ndef_card_state_e)target_info_private->ndefCardState;
(net_nfc_target_info_s *)target_info;
if (target_info == NULL || max_size == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*max_size = target_info_private->maxDataSize;
(net_nfc_target_info_s *)target_info;
if (target_info == NULL || actual_data == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
*actual_data = target_info_private->actualDataSize;
int i = 0;
if (keys == NULL || number_of_keys == NULL || target_info == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
if (handle->tag_info_list == NULL)
- {
return NET_NFC_NO_DATA_FOUND;
- }
if (handle->number_of_keys <= 0)
- {
return NET_NFC_NO_DATA_FOUND;
- }
DEBUG_CLIENT_MSG("number of keys = [%d]", handle->number_of_keys);
- if (handle->keylist != NULL)
- {
+ if (handle->keylist != NULL) {
*number_of_keys = handle->number_of_keys;
*keys = handle->keylist;
net_nfc_tag_info_s *tag_info = handle->tag_info_list;
for (; i < handle->number_of_keys; i++, tag_info++)
- {
(*keys)[i] = tag_info->key;
- }
*number_of_keys = handle->number_of_keys;
net_nfc_tag_info_s *tag_info;
if (target_info == NULL || key == NULL || value == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
if (handle->tag_info_list == NULL)
- {
return NET_NFC_NO_DATA_FOUND;
- }
int i = 0;
tag_info = handle->tag_info_list;
- for (; i < handle->number_of_keys; i++, tag_info++)
- {
- if (strcmp(key, tag_info->key) == 0)
- {
- if (tag_info->value == NULL)
- {
+ for (; i < handle->number_of_keys; i++, tag_info++) {
+ if (strcmp(key, tag_info->key) == 0) {
+ if (tag_info->value == NULL) {
return NET_NFC_NO_DATA_FOUND;
- }
- else
- {
+ } else {
*value = tag_info->value;
break;
}
net_nfc_error_e result;
if (target_info == NULL || msg == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
result = net_nfc_create_ndef_message_from_rawdata(msg,
(data_h)&target_info_private->raw_data);
net_nfc_target_info_s *temp = NULL;
if (handle == NULL || result == NULL)
- {
return NET_NFC_NULL_PARAMETER;
- }
_net_nfc_util_alloc_mem(temp, sizeof(net_nfc_target_info_s));
if (temp == NULL)
- {
return NET_NFC_ALLOC_FAIL;
- }
temp->ndefCardState = handle->ndefCardState;
temp->actualDataSize = handle->actualDataSize;
temp->is_ndef_supported = handle->is_ndef_supported;
temp->number_of_keys = handle->number_of_keys;
- if (temp->number_of_keys > 0)
- {
+ if (temp->number_of_keys > 0) {
int i;
_net_nfc_util_alloc_mem(temp->tag_info_list, temp->number_of_keys * sizeof(net_nfc_tag_info_s));
- if (temp->tag_info_list == NULL)
- {
+ if (temp->tag_info_list == NULL) {
_net_nfc_util_free_mem(temp);
return NET_NFC_ALLOC_FAIL;
}
- for (i = 0; i < handle->number_of_keys; i++)
- {
+ for (i = 0; i < handle->number_of_keys; i++) {
if (handle->tag_info_list[i].key != NULL)
_net_nfc_util_strdup(temp->tag_info_list[i].key, handle->tag_info_list[i].key);
- if (handle->tag_info_list[i].value != NULL)
- {
+ if (handle->tag_info_list[i].value != NULL) {
data_s *data = (data_s *)handle->tag_info_list[i].value;
net_nfc_create_data(&temp->tag_info_list[i].value, data->buffer, data->length);
}
}
- if (handle->raw_data.length > 0)
- {
+ if (handle->raw_data.length > 0) {
net_nfc_util_init_data(&temp->raw_data, handle->raw_data.length);
memcpy(temp->raw_data.buffer, handle->raw_data.buffer, temp->raw_data.length);
}
return NET_NFC_NULL_PARAMETER;
list = info->tag_info_list;
- if (list != NULL)
- {
+ if (list != NULL) {
int i;
- for (i = 0; i < info->number_of_keys; i++, list++)
- {
+ for (i = 0; i < info->number_of_keys; i++, list++) {
if (list->key != NULL)
_net_nfc_util_free_mem(list->key);
}
if (info->keylist != NULL)
- {
_net_nfc_util_free_mem(info->keylist);
- }
net_nfc_util_clear_data(&info->raw_data);
NET_NFC_GDBUS_TEST(source_object),
(gint *)&out_result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish sim_test: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_test_sim_test_completed callback =
(net_nfc_client_test_sim_test_completed)func_data->callback;
NET_NFC_GDBUS_TEST(source_object),
(gint *)&out_result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish prbs test: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_test_prbs_test_completed callback =
(net_nfc_client_test_prbs_test_completed)func_data->callback;
(gint *)&out_result,
&out_version,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish get_firmware_version: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_test_get_firmware_version_completed callback =
(net_nfc_client_test_get_firmware_version_completed)func_data->callback;
NET_NFC_GDBUS_TEST(source_object),
(gint *)&out_result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish set_ee_data: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_test_set_ee_data_completed callback =
(net_nfc_client_test_set_ee_data_completed)func_data->callback;
NET_NFC_GDBUS_TEST(source_object),
(gint *)&out_result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish sim_test: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
net_nfc_client_test_ese_test_completed callback =
(net_nfc_client_test_ese_test_completed)func_data->callback;
{
NetNfcCallback *func_data;
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(NetNfcCallback, 1);
if (func_data == NULL)
net_nfc_error_e out_result = NET_NFC_OK;
GError *error = NULL;
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_test_call_sim_test_sync(test_proxy,
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call SimTest: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
{
NetNfcCallback *func_data;
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(NetNfcCallback, 1);
if (func_data == NULL)
net_nfc_error_e out_result = NET_NFC_OK;
GError *error = NULL;
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_test_call_prbs_test_sync(test_proxy,
tech,
rate,
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call PrbsTest: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
{
NetNfcCallback *func_data;
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(NetNfcCallback, 1);
if (func_data == NULL)
*version = NULL;
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_test_call_get_firmware_version_sync(test_proxy,
(gint *)&out_result,
&out_version,
NULL,
- &error) == TRUE)
- {
+ &error) == TRUE) {
*version = out_version;
- }
- else
- {
+ } else {
DEBUG_ERR_MSG("can not call Get Firmware version: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
NetNfcCallback *func_data;
GVariant *variant;
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(NetNfcCallback, 1);
- if (func_data == NULL) {
+ if (func_data == NULL)
return NET_NFC_ALLOC_FAIL;
- }
func_data->callback = (gpointer)callback;
func_data->user_data = user_data;
GVariant *variant = NULL;
GError *error = NULL;
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
variant = net_nfc_util_gdbus_data_to_variant((data_s *)data);
variant,
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call SetEeTest: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
DEBUG_CLIENT_MSG("NFC ESE Test!!!!");
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
func_data = g_try_new0(NetNfcCallback, 1);
if (func_data == NULL)
DEBUG_CLIENT_MSG("NFC ESE Test SYNC!!!!");
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_test_call_ese_test_sync(test_proxy,
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call ESE Test: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
net_nfc_error_e out_result = NET_NFC_OK;
GError *error = NULL;
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_test_call_set_se_tech_type_sync(test_proxy,
(guint32)type,
(guint32)tech,
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call SetSeTechType: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
DEBUG_CLIENT_MSG("net_nfc_client_test_set_listen_tech_mask_sync start");
- if (test_proxy == NULL)
- {
- if(net_nfc_client_test_init() != NET_NFC_OK)
- {
+ if (test_proxy == NULL) {
+ if (net_nfc_client_test_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("test_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
if (net_nfc_gdbus_test_call_set_listen_tech_mask_sync(test_proxy,
tech,
&result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("can not call listen tech mask: %s",
error->message);
result = NET_NFC_IPC_FAIL;
{
GError *error = NULL;
- if (test_proxy)
- {
+ if (test_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/Test",
NULL,
&error);
- if (test_proxy == NULL)
- {
+ if (test_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_test_deinit(void)
{
- if (test_proxy)
- {
+ if (test_proxy) {
g_object_unref(test_proxy);
test_proxy = NULL;
}
data_s transceive_info = { NULL, };
GVariant *variant;
- if (data == NULL)
- {
+ if (data == NULL) {
DEBUG_ERR_MSG("data is empty");
return NULL;
}
- switch (devType)
- {
- case NET_NFC_MIFARE_MINI_PICC :
- case NET_NFC_MIFARE_1K_PICC :
- case NET_NFC_MIFARE_4K_PICC :
- case NET_NFC_MIFARE_ULTRA_PICC :
+ switch (devType) {
+ case NET_NFC_MIFARE_MINI_PICC:
+ case NET_NFC_MIFARE_1K_PICC:
+ case NET_NFC_MIFARE_4K_PICC:
+ case NET_NFC_MIFARE_ULTRA_PICC:
if (net_nfc_util_init_data(&transceive_info,
- data->length + 2) == true)
- {
+ data->length + 2) == true) {
memcpy(transceive_info.buffer,
data->buffer,
data->length);
}
break;
- case NET_NFC_JEWEL_PICC :
- if (data->length > 9)
- {
+ case NET_NFC_JEWEL_PICC:
+ if (data->length > 9) {
DEBUG_ERR_MSG("data length is larger than 9");
return NULL;
}
- if (net_nfc_util_init_data(&transceive_info, 9) == true)
- {
+ if (net_nfc_util_init_data(&transceive_info, 9) == true) {
memcpy(transceive_info.buffer,
data->buffer,
data->length);
}
break;
- default :
- if(net_nfc_util_init_data(&transceive_info,
- data->length) == true)
- {
+ default:
+ if (net_nfc_util_init_data(&transceive_info,
+ data->length) == true) {
memcpy(transceive_info.buffer,
data->buffer,
data->length);
(gint *)&out_result,
&out_data,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish transceive: %s", error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
data_s resp = { NULL, };
net_nfc_util_gdbus_variant_to_data_s(out_data, &resp);
NET_NFC_GDBUS_TRANSCEIVE(source_object),
(gint *)&out_result,
res,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Can not finish transceive: %s", error->message);
out_result = NET_NFC_IPC_FAIL;
g_error_free(error);
}
- if (func_data->callback != NULL)
- {
+ if (func_data->callback != NULL) {
((nfc_transceive_callback)func_data->callback)(
out_result,
func_data->user_data);
NetNfcCallback *funcdata;
GVariant *arg_data;
- if (transceive_proxy == NULL)
- {
- if(net_nfc_client_transceive_init() != NET_NFC_OK)
- {
+ if (transceive_proxy == NULL) {
+ if (net_nfc_client_transceive_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("transceive_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
return NET_NFC_NULL_PARAMETER;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL || target_info->handle == NULL)
arg_data = transceive_data_to_transceive_variant(target_info->devType,
rawdata);
- if (arg_data == NULL) {
+ if (arg_data == NULL)
return NET_NFC_INVALID_PARAM;
- }
funcdata = g_try_new0(NetNfcCallback, 1);
if (funcdata == NULL) {
NetNfcCallback *funcdata;
GVariant *arg_data;
- if (transceive_proxy == NULL)
- {
- if(net_nfc_client_transceive_init() != NET_NFC_OK)
- {
+ if (transceive_proxy == NULL) {
+ if (net_nfc_client_transceive_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("transceive_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
return NET_NFC_NULL_PARAMETER;
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL || target_info->handle == NULL)
arg_data = transceive_data_to_transceive_variant(target_info->devType,
rawdata);
- if (arg_data == NULL) {
+ if (arg_data == NULL)
return NET_NFC_INVALID_PARAM;
- }
funcdata = g_try_new0(NetNfcCallback, 1);
if (funcdata == NULL) {
if (handle == NULL || rawdata == NULL)
return NET_NFC_NULL_PARAMETER;
- if (transceive_proxy == NULL)
- {
- if(net_nfc_client_transceive_init() != NET_NFC_OK)
- {
+ if (transceive_proxy == NULL) {
+ if (net_nfc_client_transceive_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("transceive_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL || target_info->handle == NULL)
arg_data,
(gint *)&out_result,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Transceive (sync call) failed: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
if (handle == NULL || rawdata == NULL)
return NET_NFC_NULL_PARAMETER;
- if (transceive_proxy == NULL)
- {
- if(net_nfc_client_transceive_init() != NET_NFC_OK)
- {
+ if (transceive_proxy == NULL) {
+ if (net_nfc_client_transceive_init() != NET_NFC_OK) {
DEBUG_ERR_MSG("transceive_proxy fail");
return NET_NFC_NOT_INITIALIZED;
}
}
/* prevent executing daemon when nfc is off */
- if (net_nfc_client_manager_is_activated() == false) {
+ if (net_nfc_client_manager_is_activated() == false)
return NET_NFC_NOT_ACTIVATED;
- }
target_info = net_nfc_client_tag_get_client_target_info();
if (target_info == NULL || target_info->handle == NULL)
(gint *)&out_result,
&out_data,
NULL,
- &error) == FALSE)
- {
+ &error) == FALSE) {
DEBUG_ERR_MSG("Transceive (sync call) failed: %s",
error->message);
out_result = NET_NFC_IPC_FAIL;
}
if (response && out_data != NULL)
- {
*response = net_nfc_util_gdbus_variant_to_data(out_data);
- }
return out_result;
}
{
GError *error = NULL;
- if (transceive_proxy)
- {
+ if (transceive_proxy) {
DEBUG_CLIENT_MSG("Already initialized");
return NET_NFC_OK;
"/org/tizen/NetNfcService/Transceive",
NULL,
&error);
- if (transceive_proxy == NULL)
- {
+ if (transceive_proxy == NULL) {
DEBUG_ERR_MSG("Can not create proxy : %s", error->message);
g_error_free(error);
void net_nfc_client_transceive_deinit(void)
{
- if (transceive_proxy)
- {
+ if (transceive_proxy) {
g_object_unref(transceive_proxy);
transceive_proxy = NULL;
}
* @brief RTD(Record type definition) Type - Alternative Carrier type.
* @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
*/
-const unsigned char NFC_RECORD_ALTERNATIVE_CARRIER_TYPE[2] = { 'a','c' };
+const unsigned char NFC_RECORD_ALTERNATIVE_CARRIER_TYPE[2] = { 'a', 'c' };
/**
* @brief RTD(Record type definition) Type - Handover Carrier type.
* @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
*/
-const unsigned char NFC_RECORD_HANDOVER_CARRIER_TYPE[2] = { 'H','c' };
+const unsigned char NFC_RECORD_HANDOVER_CARRIER_TYPE[2] = { 'H', 'c' };
/**
* @brief RTD(Record type definition) Type - Handover Request type.
* @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
*/
-const unsigned char NFC_RECORD_HANDOVER_REQUEST_TYPE[2] = { 'H','r' };
+const unsigned char NFC_RECORD_HANDOVER_REQUEST_TYPE[2] = { 'H', 'r' };
/**
* @brief RTD(Record type definition) Type - Handover Select type.
* @ingroup CAPI_NETWORK_NFC_NDEF_RECORD_MODULE
*/
-const unsigned char NFC_RECORD_HANDOVER_SELECT_TYPE[2] = { 'H','s' };
+const unsigned char NFC_RECORD_HANDOVER_SELECT_TYPE[2] = { 'H', 's' };
int nfc_ndef_record_create(nfc_ndef_record_h *record,
nfc_record_tnf_e tnf,