If your attribute is defined as 2 bytes in length, then you are probably getting an error from the GattsWriteAttributeValue() command; Check the response to be sure, but otherwise for an easy fix:
Change the len to 2, and assign a 0 to the byte you don't use.
try in this way:
tempHandle.attrHandle = CYBLE_SOLENOID_READ_SOLENOID_TIMEOUT_CHAR_HANDLE;
newvalue= (uint8) (SolTOTime >> 8);
newvalue  = (uint8) (SolTOTime & 0x00FF);
tempHandle.value.val = newvalue;
tempHandle.value.len = 2;
tempHandle.attrHandle = CYBLE_SOLENOID_READ_SOLENOID_STATE_CHAR_HANDLE;
newvalue= (uint8) SolenoidState;
tempHandle.value.len = 1;
That fixed it, but I don't understand why it works and my code didn't?
I'm also not clear on exactly how the function CyBle_GattsWriteAttributeValue does anything based on looking at it's code.
Oh well, it works and I'm grateful for your help.
Actually, I tried the fix you suggested and it didn't really work. But thanks, anyway.
tempHandle.value.val is a pointer to an array containing data of length tempHandle.value.len.
As @user_15163247 stated in his code above, you need to declare space for an array and then pass the pointer to that array in the CYBLE_GATTS_HANDLE_VALUE_NTF_T struct. It could be you got lucky with the incorrect location/pointer dereferencing when the first function ran, but not the second one.
Here is the relevant documentation from the PSoC Creator:
/** Pointer to the value to be packed */
/** Length of Value to be packed */
/** Out Parameter Indicating Actual Length Packed and sent over the air. Actual length
can be less than or equal to the 'len' parameter value. This provides information
to application that what is the actual length of data that is transmitted over the
air. Each GATT procedures defines different length of data that can be transmitted
over the air. If application sends more than that, all data may not transmitted over air.*/
(The pointer addressing/dereferencing is due to the code being written in C/C++, as other higher level coding languages such as java, python, VB don't use pointers as much.)
The answer to this pointers - How come an array's address is equal to its value in C? - Stack Overflow post might be useful in understanding the problem that occurred.
And here is some examples for doing it the right way: